简体   繁体   English

Extjs将网格连接到表单

[英]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. 要处理网格中的值:从网格存储中读取值,并调用Ext.Ajax.request从网格传递您想要的任何数据。

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. 要禁用表单按钮,直到您单击某些内容,只需传入disabled:true即可配置。 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 然后你听网格http://docs.sencha.com/ext-js/4-0/#/api/Ext.grid.Panel-event-itemclick并调用button.enable当发生这种情况时

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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