English 中文(简体)
如何从数据中提取数据。
原标题:How to extract the data from data.store to an array?

这里是我的Xml法典:

<?xml version="1.0" encoding="UTF-8"?>
<root>
<investors>
    <investor name="Active"/>
    <investor name="Aggressive"/>
    <investor name="Conservative"/>
    <investor name="Day Trader"/>
    <investor name="Very Active"/>
</investors>    
<events>
    <event period="3 Month Expiry"/>
    <event period="LEAPS"/>
    <event period="Monthlies"/>
    <event period="Monthly Expiries"/>
    <event period="Weeklies"/>
</events>
<prices>
    <price rate="$0.5"/>
    <price rate="$0.05"/>
    <price rate="$1"/>
    <price rate="$22"/>
    <price rate="$100.34"/>
</prices>   
</root>

我的守则是:

    Ext.onReady(function(){
                     var hi= [],hello = [], hey = [];
      Ext.getBody().mask(true,  <div class="demos-loading">Loading&hellip;</div> );  
    var tsstore = new Ext.data.Store({    
        url:  xmlformat.xml ,
        autoLoad: true,
        reader: new Ext.data.XmlReader({
               record:  investor 
           }, [{name:  name , mapping:  @name }])
    });

   var evstore = new Ext.data.Store({    
        url:  xmlformat.xml ,
        autoLoad: true,
        reader: new Ext.data.XmlReader({
               record:  event 
           }, [{name:  Eve , mapping:  @period }])
    });

   var prstore = new Ext.data.Store({    
        url:  xmlformat.xml ,
        autoLoad: true,
        reader: new Ext.data.XmlReader({
               record:  price 
           }, [{name:  Pri , mapping:  @rate }])
    });
    var tsgrid = new Ext.grid.GridPanel({
        store: tsstore,
        columns: [{header: "Trading Style", dataIndex:  name , sortable: true}],
        renderTo: example-grid ,
        width:540,
        height:200
    });
    var evgrid = new Ext.grid.GridPanel({
        store: evstore,
        columns: [{header: "Events", dataIndex:  Eve , sortable: true}],
        renderTo: example-gridone ,
        width:540,
        height:200
    });
    var prgrid = new Ext.grid.GridPanel({
        store: prstore,
        columns: [{header: "Price", dataIndex:  Pri , sortable: true}],
        renderTo: example-gridtwo ,
        width:540,
        height:200
    });



hello.push(tsstore.getRange());


});

储存在“书店”中的数据,希望将其复制成一个阵列。

i 想要产出:

hello = {"$0.5","$0.05","$1","$22","$100.34"}

but it s not working for me please help thank you

最佳回答

我们应该这样做。 确保“R”资本化。

假设你的问题只是一个字体,如果获得Range(Range)()一片记录,那么贵方的储存可能不会适当装载记录。 你们是否相信你的储存是适当装载记录? 使用火桶在装载后检查储存。

EDIT Looks like you re running getRange() before the store is done loading the data. You re loading the store upon creation (autoLoad:true), but then you re immediately running getRange() (while the XMLHttpRequest is still pending in the background!).

你们需要听一下储存的<代码><>/代码>活动,并且有手操作数据。

<><><><>>>>>> 这项工程:

Ext.onReady(function(){
        console.log( hi );
        var prstore = new Ext.data.Store({
                url:  xmlformat.xml ,
                autoLoad: true,
                reader: new Ext.data.XmlReader({
                        record:  price 
                    }, [{name:  Pri , mapping:  @rate }])
            });

        prstore.on( load ,function(store,records,opts){                    
                console.log(store.getRange());
            });


    });

你们应当能够看到一系列数据。 页: 1

问题回答

暂无回答




相关问题
ExtJS load form items/fields from database

I am using ExtJS 3 here. I would like to populate a formpanel from database with fields to be submitted. Basically, I don t know witch fields my form will have and I want to generate all formpanel ...

How to use Ext JS for role based application

I am planning to use Ext JS for a large application. The application s features are role based. When user login, they only see menu and screen features related to them. My server side technology will ...

Dynamically adding a TabPanel to a Panel Region

I have a Panel layout with a TreePanel in one region. A user clicks on an node in the tree and a TabPanel should be displayed in another region with information, editing tools etc. for that tree node....

How to embed Json result within Extjs Panel?

I have some issues with Json result and embed it within the html of the Extjs Panel. Here s that I have managed to get so far. myPanel is embedded within a mainPanel, and I have some shows/hide of ...

Ajax data update. Extjs

I need to keep certain data ( in a grid) up to date and was gonna do a poll to the server every 15 seocnds or so to get the data and refresh the grid, however it feels a bit dirty ( the grid will have ...

Better way to call superclass method in ExtJS

All the ExtJS documentation and examples I have read suggest calling superclass methods like this: MyApp.MyPanel = Ext.extend(Ext.Panel, { initComponent: function() { // do something MyPanel ...

Merged Headers in Ext JS Grid

Is it possible to have two headers in Ext JS grids? I have to show my grid as grouped data.. for example product types and products. In my case I need a grid like this: Field | Product Type A ...

热门标签