zoukankan      html  css  js  c++  java
  • easyui中加载table列表数据 第一次有数据第二次没有数据问题

      $('#allUsingProductTable').datagrid({  加载数据时,第二加载时table会发生变化会出现找不到问题。如果是弹框没有影响,弹框出现出现列表每次都会执行销毁方法。

    解决办法

    发送ajax请求获取数据,用$('#usingProductTableUpdate').datagrid('loadData', data.rows);加载数据

    $(function(){
    $('#usingProductTableUpdate').datagrid({
    'auto',
    height:'200px',
    striped: true,
    fit: true,
    pagination: true,
    scrollbarSize: 0,
    singleSelect: true,
    url:'',
    loadMsg: '数据加载中请稍后……',
    columns: [[{
    field: 'bad_survey_no',
    title: '不良调查编号',
    align: 'center',
    resizable: false,
    '10%'
    },{
    field: 'product_name',
    title: '商品名称',
    align: 'center',
    resizable: false,
    '15%'
    },{
    field: 'product_no',
    title: '产品编号',
    align: 'center',
    resizable: false,
    '18%'
    }, {
    field: 'starttime_frame',
    title: '用药开始时间',
    align: 'center',
    resizable: false,
    '18%'
    }, {
    field: 'endtime_frame',
    title: '用药结束时间',
    align: 'center',
    resizable: false,
    '18%'
    }, {
    field: 'common_name',
    title: '通用名称',
    align: 'center',
    resizable: false,
    '16%'
    }
    ]],
    method: 'post',
    toolbar: [{
    text:'清空',
    iconCls: 'icon-help',
    handler: function(){
    var row=$('#badSurveyTable').datagrid('getSelected');
    if(row){
    $.messager.confirm('删除数据', '您确定清空数据吗?', function(r){
    //清空类表数据
    $('#usingProductTableUpdate').datagrid('loadData', {total: 0, rows: []});
    });

    }else{
    $.messager.show({
    title:'提示',
    msg: '至少选择一条',
    showType:'show'
    });
    }

    }
    }]
    });
    })
    function updateUsing(bad_survey_no){

    $.post('<%=basePath%>survey/findAddUsingProductmsg.do?bad_survey_no='+bad_survey_no,
    function (data) {
    //alert(data.rows)
    $('#usingProductTableUpdate').datagrid('loadData', data.rows);
    },'json');
    }

  • 相关阅读:
    Unity3D_08_XML文件创建,读取,修改,添加
    Unity3D_07_日志、文本打印
    Unity3D_06_根据Transform、GameObject和Tag获取子对象集合
    Unity3D_05_理解Unity的新GUI系统(UGUI)
    Unity3D_04_GameObject,Component,Time,Input,Physics
    Unity3D_03_代码及效率优化总结
    Unity3D_02_基类MonoBehaviour/自带函数以及脚本执行的生命周期
    Unity3D_01_各种寻找GameObject方法
    人工智能相关
    ubuntu 安装 typora
  • 原文地址:https://www.cnblogs.com/xianz666/p/12052931.html
Copyright © 2011-2022 走看看