473,325 Members | 2,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

How to get checkbox in a grid panel?

Hello all,
How to get a checkbox column in a grid panel? I want to have both normal columns and also a column of checkbox. Finally i read the record row wise not based on the checkbox which is selected. Can i have the grid panel with the above said options?
I'm a newbie in ExtJS and using 2.3 for my project any tutorial to learn that is appreciable. Please help me with some example or tutorial :(
May 31 '10 #1

✓ answered by gits

here is an example ... have a look at the code there ...

kind regards

4 16025
gits
5,390 Expert Mod 4TB
here is an example ... have a look at the code there ...

kind regards
May 31 '10 #2
@gits
Hello gits... I saw your example. But when i tried it, i got this error...
'Ext.grid.CheckColumn' [undefined] is not a constructor.

I dont know how to resolve this error :(
May 31 '10 #3
@vibhakhushi
Thank You gits... I resolved the error :) As it was a plugin i need to include this also in my code
Expand|Select|Wrap|Line Numbers
  1. Ext.grid.CheckColumn = function(config){
  2.     Ext.apply(this, config);
  3.     if(!this.id){
  4.         this.id = Ext.id();
  5.     }
  6.     this.renderer = this.renderer.createDelegate(this);
  7. };
  8.  
  9. Ext.grid.CheckColumn.prototype ={
  10.     init : function(grid){
  11.         this.grid = grid;
  12.         this.grid.on('render', function(){
  13.             var view = this.grid.getView();
  14.             view.mainBody.on('mousedown', this.onMouseDown, this);
  15.         }, this);
  16.     },
  17.  
  18.     onMouseDown : function(e, t){
  19.         if(t.className && t.className.indexOf('x-grid3-cc-'+this.id) != -1){
  20.             e.stopEvent();
  21.             var index = this.grid.getView().findRowIndex(t);
  22.             var record = this.grid.store.getAt(index);
  23.             record.set(this.dataIndex, !record.data[this.dataIndex]);
  24.         }
  25.     },
  26.  
  27.     renderer : function(v, p, record){
  28.         p.css += ' x-grid3-check-col-td'; 
  29.         return '<div class="x-grid3-check-col'+(v?'-on':'')+' x-grid3-cc-'+this.id+'"> </div>';
  30.     }
  31. };
thank you so much for your help :)
May 31 '10 #4
meFab
1
Your proposed solution works great in Ext JS < 4. In 4 and above gridView looses the mainBody property... Has anyone found how to make this work in ExtJS 4 and above?

@vibhakhushi
Nov 28 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Piet | last post by:
Hello, I have written a small program which dynamically displays data from a data structure in a wx.grid. The grid reacts as expected when the data structure is enlarged: a new row is added and...
1
by: Doug | last post by:
hello, i have got a panel with several controls in it, including a button which is disabled. I want to enable this button whenever, any of the controls inside the panel changes. e.g. someone...
10
by: Jennyfer J Barco | last post by:
Hello, I have a datagrid that brings some information from a query. I need to have a checkbox in each row so the user can select the rows he wants to reprint. Is it possible to have a checkbox...
4
by: Wolfgang Uhr | last post by:
Hello I've the following code Panel pnlData = new System.Windows.Forms.Panel(); CheckBox checkBox = new System.Windows.Forms.CheckBox(); checkBox.AutoSize = true; checkBox.Dock =...
10
by: markwalker84 | last post by:
Hello everyone! Got a bit of a problem... Two of the panels on my program contain a number of check boxes. The exact number of which is determined by a pair of variables. I have recently...
0
by: hamstrd | last post by:
Hi all, i am working on an assignment where i have to design an automatic check in system for an airport. I am using the swing library, as well as using actionlisteners. My issue is, that i try...
3
by: vibhakhushi | last post by:
here is my code: var expGroupStore = new Ext.data.GroupingStore({ id: 'profile_data'+ labId + userName, // proxy: new Ext.data.HttpProxy({ // url:...
3
by: thirdconspiracy | last post by:
This is probably a stupid question but why is part of my text missing when I add a checkbox to my panel? Displays fine: ASLThoracic.Text = "L Thoracic"; ASLThoracic.Text = "L Thoracic/Lum"; ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.