retrieve checkbox values..
guyz.. pls pls help me.. im new wd d checkbox thing bout i was able to do quite good wid it.. my problem is that i place a checkbox in the 1st column of the grid. im usng the checkbox template given here in the forum. i used the templates.checkboxLabel.. and so the 1st column has the chkbox with an IDnum.. sortng is well.. but i cant really find a way as to how to retrieve the IDnum's of every chkbox checked..
my program goes like this.. i list all the data in the grid and has a corresponding chkbox for each row. each datum has a IDnum so i attached the IDnum wid the checkbox label. once the user pressed the submit button, i have to retrieve the IDnums whch has its chkbox checked.. please... thnx! asap.. :)
AvtiveWidgets.. dude, this has to have some recogntion!! :)
Can u please share how u had used check box template.
... problem solved. thanx anyway! =) i had a hard time wid identfying if a checkbox in a row was checked or not. but i solved it manually. i did some changes wid the togglevalue function where in everytime the chckbox is click, it's row value [id num] is passed in a textbox. tehn i did some strng mnipulations to identify which is which. tnx agen! hoping you guyz wud stil answer my queries agen if ever il have probz..
Some confussion. I am not expert. Actually, i am also hunting how to set check box in grid. I am not able to do it some how. Dnt kno whats wrong. So please share ur code. :)
//placing a checkbox in the first column of a grid
var chkTemplate = new My.Templates.Checkbox;
i dont quite get ur problem.. do u want to set the checkbox [checked at onload] or place a checbox in a grid?..
in placing a chkbox in the grid, i used the chkbox template which was posted in a forum here.. then added the code above in my php script..
Actually i need checkbox template itself.
Before u make post let me explain my problem.
To put checkbox in grid i have hard coded for myDaya ayyar by givind value in first column as <INPUT TYPE='CHECKBOX' NAME='selectedChips' value=''>.
This in did displays check box in first column.
but problem is that if i check few check boxes n then sort by clicking any header, the check box do not retain their state. i mean they get unchecked automatically.
After searching on site i realised that to put check box in grid, it is beeter to use check box template. I assume using template will retain check box status after sorting.
Hence i need to know where can i find template n how to use it.
Thus i requested for ur code..:)
please help me out..:)
i actually used that template but i did some canges with its toggleValue function.. ofcorz by the help of some forums here..
var originalVal = this.getItemProperty("text");
// pass the row text to a textbox...
parent.document.mattermainform.relmatno.value = parent.document.mattermainform.relmatno.value+originalVal+",";
//fix - locate object clicked instead of this
var src = event.srcElement;
//preserve checkbox state once
var trueState = this.getCheckedProperty("true");
var falseState = this.getCheckedProperty("false");
newValue = (src.checked) ? trueState:falseState;
porblem here is that if you wud sort the grid, the chekcbox selected will again be unchecked.. i think we have to over ride the sort function of the grid then check whcih chkbox were already checked and retain its state.. i think i have a correct logic but i find it hard to implement..
do you have any suggestions?..
Beside retaning checked status i am also facing weared problem.
When i click header to sort grid, all check boxes are checked or unchecked , also the text values inside grid are gets changed to yes or no.
i guess the template we are using is not stable. Also the template is not released by ActiveWidgets guys.
In some of the forum post reply, Alec has mentioned that they don't have such template.
Please let me know if u come across any solution. :)
hi did any fo you find to write the code for the checkbox.
This topic is archived.
Back to support forum