Solved

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

Posted on 2010-08-15
3
468 Views
Last Modified: 2012-05-10
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
Comment
Question by:mferna22
  • 2
3 Comments
 
LVL 10

Expert Comment

by:Jini Jose
ID: 33441522
you have to loop through the grid records to get the selected records
0
 

Author Comment

by:mferna22
ID: 33442526
Ok, but how do i go through the grid records to get the selected ones
0
 

Accepted Solution

by:
mferna22 earned 0 total points
ID: 33442669
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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now