Editor fields options& select datasource

Editor fields options& select datasource

YudsTableYudsTable Posts: 6Questions: 3Answers: 0
edited March 2016 in Free community support

Thank you for come here,
I have two questions:
First is while define the fields options of editor,like this

"fields": [
        {
        label: "businessName:",
        name: "businessName"     
    }, {
        label: "customName:",
        name: "customName"     
    }

can I set one field invisible but also can be submit to server,
another one is can we use the remote dynamic data as the select options but not define in initialization

{
        label: "type:",
        name: "type",
        type:"select",
        options: [
                  { label: "B2B", value: 1 },
                  { label: "B2C",    value: 2 },
                  { label: "C2C",    value: 3 },
                  { label: "UED",    value: 4 }
              ]
    }

Is that feasible to use the data from ajax request as the options data

$.ajax{
  var custom;
        $.ajax({
           url:  '/business/add',
           success:function(data){
               custom=data;
           }
        });
}

  type:"select",
  options:custom

I return json to the ajax request but it doesn't work what should I modify

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • allanallan Posts: 63,785Questions: 1Answers: 10,511 Site admin

    can I set one field invisible but also can be submit to server,

    Use hidden.

    another one is can we use the remote dynamic data as the select options but not define in initialization

    Yes - use the update method of the select field type to update the information in the list from your Ajax request.

    Allan

This discussion has been closed.