Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: Checkbox in a wwWebDataGrid

$
0
0
Re: Checkbox in a wwWebDataGrid
Web Connection 5.0
Re: Checkbox in a wwWebDataGrid
04/18/2012
09:20:43 PM
3HD19R21L Show this entire thread in new window
Gratar Image based on email address
From:
Luca
To:
Attachments:
None
Dear Rick,
I prefer to allow data editing in a edit page loaded after the grid page, by clicking on ID link. This is easier for me to check for validations into every controls. So I will show checkbox pictures in grids.
Thank you very much again!


My recommendation is that if you just want to display check status, don't use a checkbox but use an image. Something like this:

FUNCTION checkBoxValue() if isCheckedValue RETURN [<img src="images/checked.gif" />] endif *** Don't display anything for unchecked *** or alternately display a different image RETURN "" ENDFUNC

I think that checkboxes don't look neither nice nor serve a good purpose if you don't allow editing of them in the grid (which is actually not that easy to do unless you use AJAX callbacks anyway - using a separate page is a good choice IMHO).

+++ Rick ---

Wonderful!

1) Please, is it a way to make checkboxes read only in Grids? I would like to change their "checked" value in a edit page, not in a grid page.

2) Please, is it possible to write the DrawCheckBox function in Process.prg in order to use it even for other webpages? How would change the "this.Page." webpage syntax?

Thank you very much again



No. You can't embed controls into a datagrid. However you can generate HTML into them either using string text or a function.

<ww:wwWebDataGridColumn id="wwWebDataGridColumn2" Expression="this.Page.DrawCheckBox()" />

You can then implement a page level function that produces the HTML for this control

FUNCTION DrawCheckBox() lcOutput = [<input type="checkbox" id="chkControl_] + TRANS(cursor.Id) + ; [" ] + iif(cursor.IsReqiured,[ checked="checked"],[]) + ; [/>] RETURN lcOutput ENDFUNC

More info here:
wcdocs:_1oj1boxsb.htm

+++ Rick ---


Dear Rick,
please is it possible to have a Checkbox (for a logical field) in a wwWebDataGrid's Column?
Thank you very much






Viewing all articles
Browse latest Browse all 10393

Trending Articles