1. 确定表单网格字段ID。在这个例子中,它是 "entries".
  2. 构造对应于项目行表单的JSON对象。

    Code
    var args = new Object();
    args['result'] = '{"amount":"1","category":"Medical","claim":"","purpose":"a","date":"11/18/2015","formattedAmount":"$ 1.00"}';
  3. 基于#1中的标识符,调用FormGrid的add方法添加一个新行。

    Code
    // the field id is "entries"
    var field = FormUtil.getField("entries");
    var functionName = window[field.attr("id") + "_add"];
    if(typeof functionName === 'function') {
        var args = new Object();
        args['result'] = '{"amount":"1","category":"Medical","claim":"","purpose":"a","date":"11/18/2015","formattedAmount":"$ 1.00"}';
        functionName(args);
    }




 

 

 

 

  • No labels