English 中文(简体)
Extjs4,如何获取选中的行存储?
原标题:Extjs4, How to get selected row store?
  • 时间:2012-05-25 16:31:59
  •  标签:
  • extjs4

我想绘制一个基于另一个网格中选定行的网格。

我想重用原始网格的存储。所以我需要过滤商店,只选一个。

有可能吗?还是我必须再次为新网格定义存储?

前-

var myGrid = this.oriGrid().getSelectionModel().getSelection();

var myWindow = Ext.create( Ext.window.Window , {
    title:  Test ,
    autoHeight: true,
    width: 700,
    layout:  fit ,
    modal: true,
    items: {
    xtype:  grid ,
    columns: [
        { header:  PK , dataIndex:  PK , flex: 1 },
        { header:  FK , dataIndex:  FK , width: 200 },
    ],
    store: myGrid[0].store // it will show all of list, I want to show only I selected row.
    }
}).show();

谁知道,请给我建议~谢谢!

最佳回答

如果同时显示两个UI元素,则不能使用具有不同过滤器的同一存储对象。

您需要克隆存储并将所需的记录复制到另一个实例中。

问题回答

我认为这里有更好的解决方案。是继承了商店、新店和用户过滤功能,就像你的选择一样:

 secGridStore = new Ext.Data.Store( YourStore );
 secGridStore.filter({
   filterFn: function(item) { return (item in YourStore) } 
 }); 

很抱歉,这段代码不正确,但你可以看到我的想法。





相关问题
How to use JSON without json file?

I need to use dynamically JSON with data.TreeStore. With this component, there is proxy "config", it need a path to JSON file. My problem is, i can t write Json file in my application. I would know, ...

Dynamic Model with ExtJS 4

With ExtJS 3.x, I was able to use the "fields" property of a Store, but it seems with ExtJS 4 I have to absolutely use a Model. It s fine, but in my case, it s not a static Model, and I need to define ...

TreeNode click event on ExtJs 4

I m using ExtJS 4 (beta 3) and I have a TreePanel that is my kind of navigation menu. It is something like this: Jobs Add Job List All Jobs ... ... ... (this will be made on a permission system ...

Ext.loader not enabled Missing required?

I have some problems with Extjs4 librairie. I want to use treeEditor component. Firebug error : Error : uncaught exception: Ext.Loader is not enabled, so dependencies cannot be resolved ...

how to make a "MVC Application" with extjs 4.0 beta 3?

Is there someone here who made a MVC application using EXTJS 4 BETA 3? and works fine?? please help me how?, .. I have followed step by step here .. and @Abdel Olakara help but there is still an ...

Object function has no method defer

I m try to render a progress bar in grid (Ext JS), and get this error: Object function has no method defer What is this "magical" method? What does it do? And why is it not found? Code: renderer:...

热门标签