DataTables plugin for jquery and click event
2010-05-24 12:30
429 查看
datatables1.6.2
Iamtryingtosucceedatgettingthisjqueryplugintoworkcorretly.WhatIneedisaclickeventthatwillalowmetoclickarowandhaveajswindowthatwillloadanotherpageusingtherow_idthatistheprimarykeyinthedatabase.I'mreallylostwithjavascriptbutIlikethepluginandreallywouldliketohavethisworkifpossible.Ihavebeenatthisforacoupleofdaysnow.IknowI'mclosebuthaven'thitthemarkyet.Ifsomeonecouldpleasehelpme,I'dbereallygrateful.Iamusingjsontoimportthedata.
Hereismycurrentcode.Itwillcompilenowbutthe.clickeventwon'tfire.:/
oTable=$('#search').dataTable({
"sPaginationType":"full_numbers",
"bProcessing":true,
"iDisplayLength":15,
"sAjaxSource":'json.php',
"fnInitComplete":function(){
$(oTable.fnGetNodes()).click(function(){
//myjswindow....
});
}
});
要对选定的该行内的html标签进行选择,可以使用以下代码
[/code]
详细地址来源:、
http://www.datatables.net/examples/api/row_details.html
$('tdimg',oTable.fnGetNodes()).each(function(){
$(this).click(function(){
varnTr=this.parentNode.parentNode;
if(this.src.match('details_close'))
{
/*Thisrowisalreadyopen-closeit*/
this.src="../examples_support/details_open.png";
oTable.fnClose(nTr);
}
else
{
/*Openthisrow*/
this.src="../examples_support/details_close.png";
oTable.fnOpen(nTr,fnFormatDetails(nTr),'details');
}
});
});
Iamtryingtosucceedatgettingthisjqueryplugintoworkcorretly.WhatIneedisaclickeventthatwillalowmetoclickarowandhaveajswindowthatwillloadanotherpageusingtherow_idthatistheprimarykeyinthedatabase.I'mreallylostwithjavascriptbutIlikethepluginandreallywouldliketohavethisworkifpossible.Ihavebeenatthisforacoupleofdaysnow.IknowI'mclosebuthaven'thitthemarkyet.Ifsomeonecouldpleasehelpme,I'dbereallygrateful.Iamusingjsontoimportthedata.
Hereismycurrentcode.Itwillcompilenowbutthe.clickeventwon'tfire.:/
$(document).ready(function(){ oTable=$('#search').dataTable( { "sPaginationType":"full_numbers", "bProcessing":true, "iDisplayLength":15, "sAjaxSource":'json.php', "fnInitCallback":function() { $(oTable.fnGetNodes()).click(function() { //alert(); }); } }); });
[code]YouneedtoreplacefnInitCallBackwithfnInitCompleteanditwillwork.
"sPaginationType":"full_numbers",
"bProcessing":true,
"iDisplayLength":15,
"sAjaxSource":'json.php',
"fnInitComplete":function(){
$(oTable.fnGetNodes()).click(function(){
//myjswindow....
});
}
});
要对选定的该行内的html标签进行选择,可以使用以下代码
[/code]
详细地址来源:、
$('tdimg',oTable.fnGetNodes()).each(function(){
$(this).click(function(){
varnTr=this.parentNode.parentNode;
if(this.src.match('details_close'))
{
/*Thisrowisalreadyopen-closeit*/
this.src="../examples_support/details_open.png";
oTable.fnClose(nTr);
}
else
{
/*Openthisrow*/
this.src="../examples_support/details_close.png";
oTable.fnOpen(nTr,fnFormatDetails(nTr),'details');
}
});
});
相关文章推荐
- Nivo Slider for jquery and wordpress plugin
- Jquery for table plugin
- No plugin found for prefix 'war' in the current project and in the plugin groups
- How to Make a jQuery Plugin - Tutorial for Beginners
- No plugin found for prefix 'jetty' in the current project and in the plugin groups
- Manual Installation and Registration of Java Plugin for Linux
- jquery.datatables出现DataTables warning: table id=tabList - Cannot reinitialise DataTable. For more in
- jquery阻止冒泡事件:$('span').bind("click",function(event){event.stopPropagation();})(有用源)
- no plugin found for prefix 'tomcat 7' in the current project and in the plugin groups
- 错误整理:No plugin found for prefix 'jetty' in the current project and in the plugin groups
- libevent for linux building and installation
- And that’s what the lowest level of the Libevent API does for you
- Polyfill hashchange Event oldURL and newURL attributes for IE 9+
- 网页图片延迟加载的jQuery插件-Lazy Load Plugin for JQuery
- jQuery:The event handler and its environment(不会翻译...)
- Lazy Load - jQuery plugin for lazy loading images(基于jQuery的图片延迟加载插件)
- JQuery - chexbox click event
- No plugin found for prefix 'jetty' in the current project and in the plugin groups
- jquery crossdomain post plugin i changed bit test code suite for my env,due to the windows env is not familiar with github operation,i didn't forked form the original resposeritoy
- 分享10个使用简单的jQuery的拖放插件(drag and drop plugin)