Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  1. Determine the Form Grid Field ID. In this example, it is "entries".

    Thai

    กำหนด ID เขตข้อมูลกริดแบบฟอร์ม ในตัวอย่างนี้มันคือ "รายการ"


    Image RemovedImage Added

    Image Added

  2. Construct the JSON object that correspond to the item row's form.

    Thai

    สร้างวัตถุ JSON ที่สอดคล้องกับรูปแบบของแถวรายการ


    Image RemovedImage Added

    Code Block
    languagejs
    titleCode
    linenumberstrue
    var args = new Object();
    args['result'] = '{"amount":"1","category":"Medical","claim":"","purpose":"a","date":"11/18/2015","formattedAmount":"$ 1.00"}';
  3. Based on the identifier in #1, call the FormGrid's add method to add a new row.

    Thai

    ตามตัวระบุใน # 1 เรียกใช้วิธีการเพิ่มของ FormGrid เพื่อเพิ่มแถวใหม่

    Code Block
    languagejs
    titleCode
    linenumberstrue
    // 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);
    }

...