IrfanClemson
IrfanClemson

Reputation: 1779

ColdFusion CFGrid: Validating Input via JQuery

I have a CFGrid which allows editing of data. What I need to do is to validate user inputs via jQuery using some onblur or onchange events. But my jQuery code is unable to access the CFGrid elements using Classes. Here is a code snippet:

<td class=" x-grid-cell x-grid-cell-securityusers_ACTIVE   " id="ext-gen1066"><div class="x-grid-cell-inner " style="text-align: LEFT; ;" id="ext-gen1067">No</div></td>

The above code shows in Firebug when an editable cfgridcolumn is clicked in. So I should be able to use the following:

$('.x-grid-cell-securityusers_ACTIVE').click(function(){            
     alert('click') ;  
});

But this event never fires. I can confirm my jQuery load is fine because a container div (which holds the grid) would generate the click event.

My guess is that CFGRID, being dynamically generated, just doesn't register with JQuery; I have the javascript code also tried under a $(document).ready(function() { but still no event being fired.

Any ideas? Any alternate approach?

Thanks!

Upvotes: 1

Views: 187

Answers (1)

IrfanClemson
IrfanClemson

Reputation: 1779

Never mind. I think, per comments, the correct approach would have been to study the ExtJS APIs but I didn't have the time for that after some futile tries. So I ended up doing ColdFusion's own validations for the input data after the form post; a bit painful but it works.

Upvotes: 0

Related Questions