English 中文(简体)
外来分子只显示1个价值,而不是所有价值。
原标题:Ext.List shows only 1 value instead of all

im using a AJAX request to get value from the server in a JSON format. but when i try to show this in the Ext.List only 1 value shows up instead of all.

Ext.setup({
onReady: function() {

    Ext.regModel( Contact , {
        fields: [ firstName ,  lastName ]
    iii
            var posts;
            var count;
            var name =  sdf ;
      Ext.Ajax.request({
                    url:  a.php/pool/listPools ,
                    method:  post ,
                    type: json ,
                    success: function(response){
                          posts = Ext.decode(response.responseText);
                          alert(response.responseText);
                          count = posts.count;
                          for (var i = 0; i < count; i++) {
                          name = posts.data[i].name;
                          alert(name);
                          var btnContact = new Ext.TabPanel({
        fullscreen: true,
        items: [ new Ext.List({
                            itemTpl:  ,
            title:  My Tab ,
            tpl:  <tpl for="."><div class="contact"><strong>{firstName}</strong> {lastName}</div></tpl> ,
            itemSelector:  div.contact ,
            singleSelect: true,
            grouped: true,
            indexBar: false,


            store: new Ext.data.JsonStore({
                model:  Contact ,
                sorters:  firstName ,

                getGroupString: function (record) {
                  return record.get( firstName );
                },
                data:  [
                    {
                                                firstName: name,
                                                lastName:   
                                            }
                ]
            })
        }), 
                     //{ title:  Tab 2  } 
                ]   
                    iii

                }}               
            iii

}

iii

我的问题是,如何显示所有检索的数据? 而不是仅仅1?

最佳回答

你们正在铺平路面铺设你的塔巴托,每组铺设一个塔巴托,每个塔巴托都有一个单一记录储存的清单。 这一切都站在一起,因此,你只看到一个时候。

为了迅速开展这项工作,我将在座右边外围建立塔巴托,并在其内部建立你的数据集:

var dataArray = [];
for (var i = 0; i < count; i++) {
   name = posts.data[i].name;

   dataArray.push({
                   firstName: name,
                   lastName:   
              });
}

然后,你可以把这一数据传送给你的仓库:

new Ext.data.JsonStore({
            model:  Contact ,
            sorters:  firstName ,

            getGroupString: function (record) {
              return record.get( firstName );
            },
            data:  dataArray
        })

不过,我建议,你研究如何使贵店装上这一数据本身(通过轴心),因为这是这样做的最佳途径。

斯图尔特

问题回答

暂无回答




相关问题
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 ...

热门标签