小编dwa*_*waz的帖子

如何在jqgrid中的行上自定义按钮添加脚本?

我试图处理jqgrid中的自定义按钮的单击.我有按钮显示,但单击它们时,我的功能不会运行.如果我单击jqgrid外部的按钮,脚本将运行.jqgrid是否消耗了按钮点击?不确定我缺少什么或不理解.这是网格.我没有重新加载整个网格的原因是服务器上有太多的处理,并且一旦editurl处理"发送",需要手动删除客户端上的行.See: $(".sendbuttons").click(function(){

...

        <style type="text/css">
        .sendbuttons {
            height:19px;
            width:60px;
            color:red;
        }
    </style>

    <script language="javascript">

    jQuery(document).ready(function(){
        var last_row;
        jQuery("#gridlist").jqGrid({
            url:'manual_responses.php',
            datatype: "json",
            colNames:['ID','Image','Keyword','send Found','Proposed send',''],
            colModel:[
                {name:'item_id', index:'item_id', width:45, editable:false, hidden:true},
                {name:'image', index:'image', width:45},
                {name:'keyword',index:'keyword', width:100, editable: false},
                {name:'item_found',index:'item_found', width:130, editable: false},
                {name:'proposed_send',index:'proposed_send', width:130, editable: true, edittype:"textarea", editoptions:{rows:"2",cols:"37"}},
                {name:'options',index:'options',width:40,editable: false}
            ],
            rowNum:40,
            rowList:[20,40,60],
            imgpath: 'css/themes/sand/images',
            sortname: 'keyword',
            viewrecords: true,
            sortorder: "asc",
            caption:"Proposed sends",
            onSelectRow: function(item_id){
                if(item_id && item_id!==last_row){
                    jQuery("#gridlist").restoreRow(last_row);
                    jQuery("#gridlist").editRow(item_id,true);
                    last_row=item_id;
                }
            },
            loadComplete: function(){ 
                //alert('ok, loadComplete running');
                var ids …
Run Code Online (Sandbox Code Playgroud)

javascript ajax jquery client jqgrid

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

ajax ×1

client ×1

javascript ×1

jqgrid ×1

jquery ×1