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/19/2012
12:19:18 AM
3HE00OVHE Show this entire thread in new window
Gratar Image based on email address
From:
Rick Strahl
To:
Attachments:
None

You can use either pictures or embed the checkbox. Showing it as disabled add a readonly="readonly" attribute or disabled="disabled" per HTML standards... Not sure what will look right since it has to be obvious for the user - that's why I like images - much clearer especially if you use two images (check mark and crossed circle maybe). Plus I think images look much nicer and livier.

+++ Rick ---



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








Rick Strahl
West Wind Technologies

Making waves on the Web

from Maui, Hawaii


Viewing all articles
Browse latest Browse all 10393

Trending Articles