Grigor
Grigor

Reputation: 4059

Extjs connect grid to a form

I have a grid in Extjs that has list of information from database, now I want that list be processed through php, how would I make the grid act as a form, and when the list is clicked(multiselect true) the user gets the values of the list buttons, also, how would I disable the form buttons until list is seleted from grid?

Upvotes: 0

Views: 457

Answers (1)

Ruan Mendes
Ruan Mendes

Reputation: 92334

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

Upvotes: 2

Related Questions