View Full Version : Grid add checkbox
followmephoe
13 Sep 2007, 11:24 PM
i want to add checkbox in grid,when i click the checkbox and then press remove button,i can remove lots of data,but i do not know how to add checkobx and then to know the checkbox data.please give some adivse to me,thanks!
Animal
14 Sep 2007, 12:01 AM
Use a column renderer.
http://extjs.com/deploy/ext/docs/output/Ext.grid.ColumnModel.html#config-renderer
mystix
14 Sep 2007, 12:24 AM
once you figure out how to implement custom column renderers, you can then do this:
http://extjs.com/forum/showthread.php?p=51841#post51841
followmephoe
14 Sep 2007, 6:02 PM
thanks,but i do not know how to get the checkbox value,for example,if i click the checkbox
i want to get custom word.
another question:
can i add a checkbox on the ColumnModel?when i click it, it should be all checked
followmephoe
15 Sep 2007, 12:07 AM
animal,come to help me
Animal
15 Sep 2007, 12:18 AM
I can't understand you.
I'm going out now anyway.
followmephoe
15 Sep 2007, 12:44 AM
i say how to get the checkbox value.when i click checkbox i want to get the aid
},{
header: "编号",
dataIndex: 'aid',
width: 40,
hidden:true
},{
mystix
15 Sep 2007, 8:55 AM
I have check/Uncheck field in Editable Grid.
When I check Uncheck a cell , It makes whole record dirty.
I want to Select All / Unselect All. But It makes whole grid dirty.
I want a field that does not contribute to the dirty state of datastore. ??
Any Solution.??
/:) @imranprogrammer, to avoid annoying everyone on this forum
i.e. people who would potentially help you, might i suggest not
hijacking threads with off-topic posts
repeating the same post in the same thread
typing in bold
followmephoe
16 Sep 2007, 2:11 AM
thanks, i will check it.
i have the same problem with you.
this is one problem.
i have a button with add,when i click it,it will add new,i want to add a delete button instead
of checkbox.
followmephoe
16 Sep 2007, 2:16 AM
hello,mystix do you have QQ or email?
i want to ask you some questions from chinese,because i am not good at english,and i know you can speak chinese.my email is followmephoe@yahoo.com.cn,if you see the message,please write a letter to me,thanks!
followmephoe
16 Sep 2007, 7:02 PM
someone can help it?
followmephoe
17 Sep 2007, 12:10 AM
no person answer it?
Animal
17 Sep 2007, 12:11 AM
Make an effort yourself.
NepalPro
25 Sep 2007, 11:27 PM
Simply add a function :
function myCheckbox(val)
{
if(val == 0){
return '<input type="checkbox" />' ; //here we can have anytype of control}else if(val == 1){
return '<input type="checkbox" CHECKED/>' ;//here we can have anytype of control
}
return val;//'<input type="checkbox" name="vehicle" value="' + val '"/>';
}
Now in your column modal add a column as follows
var colModel = new Ext.grid.ColumnModel([
{header: "#",width: 30, dataIndex: 'SelectItem',
renderer: myCheckbox,
},
.....
.....
Note: We are getting data from a dataset with column named 'SelectItem'
this column as data in 0 and 1 only indicating unchecked or checked respectively
followmephoe
25 Sep 2007, 11:33 PM
i have been work out
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.