[Dojo-interest] DataGrid: preventing change of selection?

Michael Schuerig michael at schuerig.de
Fri Apr 17 17:39:02 EDT 2009


On Friday 17 April 2009, Deno Vichas wrote:
> I use the following to watch for form changes.
>
>         dojo.query("input", "dispatchForm")
>                 .filter(
>                     function(row) {
>                         return dijit.byId(row.id) != null
>                     })
>                 .forEach(
>                     function(item) {
>                         dojo.connect(dojo.byId(item.id), "onchange",
> function(e) {
>                             hasDispatchFormChanged = true;
>                         });
>                         dijit.connect(dojo.byId(item.id), "onChange",
> function(e) {
>                             hasDispatchFormChanged = true;
>                         });
>                     });
>
>
> On the function connect to onRowClick on my grid I check the Boolean
> value of hasDispatchFormChanged.  I'm using both dojo.connect and
> dijit.connect has not all of my form elements are dijits.

I already have code to watch out for changes, but I don't *just* listen 
to onChange event. On each onChange, I check the form element's value 
against the attribute originally used to populate the element. Actually, 
I compare their string (toString()) representations as, e.g., Date 
objects are not == even when they signify the same date.

Michael

-- 
Michael Schuerig
mailto:michael at schuerig.de
http://www.schuerig.de/michael/



More information about the Dojo-interest mailing list