3.0 beta 2

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!! :)
rach
September 8,
hi rach,

Can u please share how u had used check box template.

thnx
sam
September 9,
sam,

... 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..

:)

rach
rach
September 9,
hi rach,

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. :)



sam
September 9,
sam,

//placing a checkbox in the first column of a grid
var chkTemplate = new My.Templates.Checkbox;
chkTemplate.setCheckedProperty('true', 'Yes');
chkTemplate.setCheckedProperty('false', 'No');
obj.setColumnTemplate(chkTemplate,0);

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..

:)
rach
September 9,
hi rach,

Actually i need checkbox template itself.

thnx
sam
September 9,
hi rach,

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..:)
sam
September 9,
hi rach,

Did u used template described in
/datagrid.2388/checkbox-template-of-my-dream.html

i tried to use this template. But when i select some check box and then sort, entire grid displayed yes or no.

I guess this is not template u have used?
pls let me know where i can fing check box template.

thnx
sam
September 9,
sam.

i actually used that template but i did some canges with its toggleValue function.. ofcorz by the help of some forums here..

function toggleValue(){
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;
this.seItemProperty("text", newValue);
this.refresh();
}

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?..

:)
rach
September 10,
hi rach,

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. :)

thnx
sam
September 11,
hi did any fo you find to write the code for the checkbox.
fine
April 27,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.