Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 483
  • Last Modified:

How can i get all the record selected with a checkbox in Ext.Datagrid

I have added a checkbox to my ext.grid using Ext.grid.CheckboxSelectionModel but i haven't be able to get all the record selected with the checkbox to update the record.

0
mferna22
Asked:
mferna22
  • 2
1 Solution
 
Jini JoseSenior .Net DeveloperCommented:
you have to loop through the grid records to get the selected records
0
 
mferna22Author Commented:
Ok, but how do i go through the grid records to get the selected ones
0
 
mferna22Author Commented:
I found a soluition this is the code

 var modified =checkboxSel.getSelections();
                if(!Ext.isEmpty(modified)){
                    var recordsToSend = "";
                    inventarioGrid.el.mask('Saving', 'x-mask-loading'); //step 3
                    Ext.each(modified, function(record) { //step 2

                         recordsToSend = Ext.apply(record.data);
                         recordsToSend = Ext.encode(recordsToSend); //step 4
                        var jsonStr=JSON.parse(recordsToSend);
                     Ext.Ajax.request({      // step 5
                        url : 'editorgrid-ajax.php',
                      //  params :{records : recordsToSend},
                        params:{'idCaso' : jsonStr.IdCaso},
                       scope:this,
                        success : function(response) { //step 6
                            inventarioGrid.el.unmask();
                            inventarioGrid.getStore().commitChanges();
                        }});
                        });
                    inventarioGrid.stopEditing();
              }
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now