zoukankan      html  css  js  c++  java
  • datagrid 根据指定参数重新加载数据

    $('#statisticalRecordList').datagrid('reload',{
    start_date:$('#dd1').datebox('getValue'),
    end_date: $('#dd2').datebox('getValue'),
    ProductName:$('#checkProductName').val()

    });

    2.清空form表单中的数据

    $('#statisticalRecordListForm').form('clear');

    3.给指定的from表单加载数据

    $('#xyccproductUsingProductaddform').form('load', row);

    4.form  submit 提交 验证

    $('#ProductBadSurveyaddform').form('submit', {
    onSubmit: function () {
    return $(this).form('enableValidation').form('validate');
    },
    url: '<%=basePath%>xyData/badSurvey/addProductBadSurvey.do',
    success: function (data) {
    data = eval("(" + data + ")");//JSON字符串转对象

    var rows = $("#addusingprodcetheal").datagrid("getRows"); //这段代码是获取当前页的所有行。
    //alert("rows==================="+rows);
    //alert("bad_survey_no==="+data.bad_survey_no);
    //alert(rows.length==0);
    if (rows.length != 0) {
    for (var i = 0; i < rows.length; i++) {
    //获取每一行的数据
    //alert(rows[i].ProductName);//假设有ProductName这个字段
    $.ajax({
    url: "<%=basePath%>xyData/badSurvey/addUsingProduct.do?bad_survey_no=" + data.bad_survey_no,
    type: 'POST',
    dataType: 'json',
    async:false,
    data: rows[i],
    success: function (data) {
    if (i == rows.length - 1) {
    //alert("jinlaikankan=============");
    $.messager.show({
    title: '提示',
    msg: data.msg,
    showType: 'show'
    });
    }
    },
    error: function (data) {
    $.messager.show({
    title: '提示',
    msg: data.msg,
    showType: 'show'
    });
    }
    });
    }
    } else {
    //alert("data.msg=="+data.msg);
    $.messager.show({
    title: '提示',
    msg: data.msg,
    showType: 'show'
    });

    5.post 请求

    $.post( '<%=basePath%>xyData/user/selecteCompanyBasinfo.do?company_id='+company_id,
    function(result){

    },'json');

  • 相关阅读:
    121. Best Time to Buy and Sell Stock
    玩转算法2.3常见的算法复杂度分析
    数组中的逆序对
    一些基本的代码模板
    230. Kth Smallest Element in a BST
    42. Trapping Rain Water
    api token
    仿百度查询
    baidu jsonp
    How to fix Error: laravel.log could not be opened?
  • 原文地址:https://www.cnblogs.com/xianz666/p/12124913.html
Copyright © 2011-2022 走看看