Friday 15 January 2010

javascript - jQuery click button don't work after applying filter in kendo grid -



javascript - jQuery click button don't work after applying filter in kendo grid -

i have kendo grid contain button in column

first click function work when apply filter or sortable in grid click don't work more

here's code

<script type="text/javascript"> jquery.noconflict(); jquery(document).ready(function() { // kindo grid initialization jquery("#grid").kendogrid({ sortable : true, resizable : true, pageable : { pagesize : 7, messages : { display : "{0}-{1} de {2} demand", itemsperpage : "demand pages", empty : "there no demand" } }, filterable : { : false, messages : { filter : "apply", clear : "delete", info : "filter :" }, operators : { string : { eq : "equal", neq : "not equal", contains : "contains" } } } }); // input type button want click handler // work fine when apply filter on grid doesn't work more // css class of input viewicon jquery(".viewicon").click(function(){ var iddt = this.id; jquery("#consultation").hide().load("../dt/consultation/view.jsp",{id:iddt},function( response, status, xhr ) { // work }); }); }); </script> </head> <title>table</title> <body > <div id="bord"> <table id="grid" style="width: 98%"> <colgroup> <col/><col style="width: 60px" /><col/><col/><col/><col/><col/> </colgroup> <thead> <tr> <th>numéro d'affaire</th> <th>type</th> <th>etat</th> <th>demandeur</th> <th>responsable projet</th> <th>date de réception</th> <th>actions</th> </tr> </thead> <%-- info sql query recordset --%> <c:foreach var="dt_r" items="${recordset.rows}"> <tr> <td style="text-align: center">${dt_r.n_aff_proj}</td> <td align="center">dt</td> <td align="center">${dt_r.etat_dem}</td> <td align="center">${dt_r.nom_dem}</td> <td align="center">${dt_r.resp_pro}</td> <fmt:formatdate var="fmt_date_reception_demande" value="${dt_r.dat_r_d}" pattern="dd/mm/yyyy" /> <td align="center">${fmt_date_reception_demande}</td> <td align="center"> <div class="actions"> <%-- actions --%> <input type="button" title="consulter dt" class="viewicon" id="${dt_r.id_dt}" /> </div> </tr> </c:foreach> </table> </div > <div id="consultation"> </div> </body> </html>

please help

here link on jsfiddle here

you should utilize .delegate() elements create dynamically.

.delegate() attach handler 1 or more events elements match selector, or in future, based on specific set of root elements. more

jquery('#bord').on('click', '.viewicon', function() { alert("yess"); });

jsfiddle

javascript jquery kendo-grid

No comments:

Post a Comment