473,486 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to get checkbox in a grid panel?

33 New Member
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
4 16030
gits
5,390 Recognized Expert Moderator Expert
here is an example ... have a look at the code there ...

kind regards
May 31 '10 #2
vibhakhushi
33 New Member
@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
33 New Member
@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 New Member
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
4596
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
1382
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
2400
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
3231
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
35861
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
1283
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
7843
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
8324
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
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5430
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4864
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.