1. #1
    Sencha User amitava's Avatar
    Join Date
    Mar 2007
    Posts
    29
    Vote Rating
    0
    amitava is on a distinguished road

      0  

    Default Grid: Selecting multiple rows using checkbox

    Grid: Selecting multiple rows using checkbox


    Hi,
    How to select multiple rows in a grid with checkboxes? Can anyone please help with sample codes...

    TIA

  2. #2
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    Look at the grid examples. You can render a column as checkboxEditor.

  3. #3
    Sencha User amitava's Avatar
    Join Date
    Mar 2007
    Posts
    29
    Vote Rating
    0
    amitava is on a distinguished road

      0  

    Default


    Quote Originally Posted by tryanDLS
    Look at the grid examples. You can render a column as checkboxEditor.
    Thanks. I do have checkboxes in the grid, but I am trying to do something like gmail inbox where clicking a checkbox selects/deselects the row and changes the row bgcolor. Though I am not using checkboxEditor but a custom renderer for that column which returns <input type="checkbox"> instead.
    Here is the code
    Code:
    /* load existing orders in a grid */
    loadOrders: function(){
    	// create the datastore
    	var ds = new Ext.data.Store({
    		// load using HTTP
    		proxy: new Ext.data.HttpProxy({url: '/orders/orders', method: 'GET'}),
    		// the return will be XML, so lets set up a reader
    		reader: new Ext.data.XmlReader({
    			// records will have a "order" tag
    			record: 'order'
    			}, [
    			{name: 'OrderNo', mapping: 'OrderNo'},
    			{name: 'Status', mapping: 'Status'},
    			{name: 'ExamDate', mapping: 'ExamDate'},
    			{name: 'PatientName', mapping: 'PatientName'},
    			{name: 'Radiologist', mapping: 'Radiologist'},
    			{name: 'Site', mapping: 'Site'},
    			{name: 'Technician', mapping: 'Technician'},
    			{name: 'ReferringMD', mapping: 'ReferringMD'}				
    		])
    	});
    	var cm = new Ext.grid.ColumnModel([
    		{width:30, renderer: cr, resizable:false},
    		{header: "Order No", width:70, dataIndex: "OrderNo"},
    		{header: "Status", width:70, dataIndex: "Status"},
    		{header: "Exam Date", width:150, dataIndex: "ExamDate"},
    		{header: "Patient Name", width:150, dataIndex: "PatientName"},
    		{header: "Radiologist", width:150, dataIndex: "Radiologist"},
    		{header: "Site", width:70, dataIndex: "Site"},
    		{header: "Technician", width:70, dataIndex: "Technician"},
    		{id: 'g-rmd', header: "Referring MD", width:150, dataIndex: "ReferringMD"}
    	]);
    	cm.defaultSortable = true;
    	
    	ordersGrid = new Ext.grid.Grid('order-grid', {
    		ds: ds,
    		cm: cm,
    		autoExpandColumn: 'g-rmd',
    		selModel: new Ext.grid.RowSelectionModel({multipleSelect:true})
    	});
    	ordersGrid.render();
    	
    	var gridFoot = ordersGrid.getView().getFooterPanel(true);
    	
    	// add a paging toolbar to the grid's footer
    	var paging = new Ext.PagingToolbar(gridFoot, ds, {
    		pageSize: 10,
    		displayInfo: true,
    		displayMsg: 'Displaying orders {0} - {1} of {2}',
    		emptyMsg: "No orders to display"
    	});
    	
    	// add the detailed view button
    	paging.add('-', {
    		text: 'View Details',
    		cls: 'x-btn-text-icon'
    	});
    	
    	ds.load({params:{start:0, limit:10}});
    	
    	ordersGrid.getSelectionModel().selectFirstRow();
    	
    	//custom renderer for first column
    	function cr(){
    		return "<input type='checkbox' class='chk'>";
    	}
    }
    I am really stuck here running out of ideas, don't know how to force selection of a row clicking on a checkbox. :oops: Any help is much appreciated.

  4. #4
    Ext User
    Join Date
    Jul 2007
    Posts
    1
    Vote Rating
    0
    ueverson is on a distinguished road

      0  

    Smile Checkbox example

    Checkbox example


    It looks at in this site. You it will find what it looks for.

    http://extjs.com/playpen/ext-2.0/exa...rid/grid3.html

  5. #5
    Ext User
    Join Date
    Aug 2007
    Posts
    4
    Vote Rating
    0
    Hutch is on a distinguished road

      0  

  6. #6
    Ext User
    Join Date
    Aug 2007
    Posts
    37
    Vote Rating
    0
    cecol is on a distinguished road

      0  

    Default where can i download ext2.0

    where can i download ext2.0


    I want to use Ext.gird.Grid3!
    where can i download ext2.0

  7. #7
    Sencha User
    Join Date
    May 2011
    Posts
    2
    Vote Rating
    0
    abal2.antz is on a distinguished road

      0  

    Default


    But, How I get value from selected rows?
    because, I want to send the value to another grid.

    Thank you

    regards,
    Anton Mulyadi

Similar Threads

  1. context menu on multiple rows?
    By KRavEN in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 30 Mar 2007, 11:02 AM
  2. displaying multiple rows in a grid cell
    By psama in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 10 Mar 2007, 3:45 PM
  3. Pre-selecting a row in a grid
    By ElGranAzul in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 28 Nov 2006, 5:39 AM

Thread Participants: 5

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."