简体   繁体   中英

Extjs connect grid to a form

我在Extjs中有一个网格,其中包含来自数据库的信息列表,现在我想通过php处理该列表,如何使网格充当表单,当单击列表(多选真)时,用户获取值列表按钮,以及如何禁用表单按钮,直到从网格中选择列表?

Your question doesn't have enough information, so I can only give you some generic pointers.

To process the values from a grid: read the values from the grid's store and call Ext.Ajax.request passing whatever data you want from the grid.

Example:

var values = [];
store.each(function(rec){
  values.push({id: rec.get('id'), value: rec.get('value')});
});
Ext.Ajax.request({url: '/my/url.php', jsonData: values});

To disable the form buttons until you click something just pass in the disabled: true to the config. You then listen for the grid's http://docs.sencha.com/ext-js/4-0/#/api/Ext.grid.Panel-event-itemclick and call button.enable when that happens

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM