-
Notifications
You must be signed in to change notification settings - Fork 7
Ajax Boxeditor
Edward edited this page Aug 19, 2013
·
20 revisions
In:
{ "method":"fetchBox", "params":[GID,CID,SID,BIDX] }
Out:
{ "result":{ "contentstructure":[ // example text (other types that work the same: textarea, html, number, autocomplete) 0:{ "key": "the key for content", "type": "text", "label": "for ui display" }, // example list of field types 1:{ "key":"listdata" "contentstructure": [ another contentstructure ], "type": "list", "label": "this is a list of elements" }, // example file upload { "key":"image", "label": "Header image", "uploadpath": "/the/path/for/upload", "type":"file" }, // example select { "key":"gender", "label": "choose a gender", "type": "select", "selections": [ 0: { key:0, text: "option 1" }, 1: { key: 1, text: "option 2" }, ... n: { key: n, text: "option n" } ] }, // autocomplete-with-links { "key": "key for content", "label": "an textinput with autocomplete and links", "emptylinktext": "Linktext if autocomplete is empty", "emptyurl": "/url/for/empty/link", "linktext": "Linktext if autocomplete has a value", "url": "/url/for/not/empty/link" "type": "autocomplete-with-links", "valuekey": "The displayed value in autocomplete box for content" }, // hidden field { "key": "key for content", "type": "hidden" }, ... ], "content": { "key":"value", ... }, "html": "the rendered output", "style: "the box style", ... } }
In:
{ "url":"path/from/contentstructure", "params":{ "file": "the file", "container": "CID", "slot": "SID", "box": "BIDX", "path": "content structure.path" } }
Out:
{ "result": "false||Image-id" }
Problem: for a certain key within a certain box (see ContentStructure) type-ahead is needed to reduce system load and to increase usability. Therefore the frontend can perform a single-key-search:
In:
{ "method": "typeAheadSearch", "params": [GRIDID,CONTAINERID,SLOTID,BOXIDX,PROPERTYKEY,SEARCHQUERY], }
Out:
{ "result": [ {"key":KEYVALUE(INT),"value":DISPLAYVALUE(STRING)} ] }
two special results are possible:
{ "result": [{"key":-1,"value":"This box seems not to implement search"}] } { "result": [{"key":-2,"value":"Box not found"}] }
Both cases are an error - seeing those is considered a bug.
In:
{ "method":"typeAheadGetText", "params":[GRIDID,CONTAINERID,SLOTID,IDX,PATH,TYPEAHEADID] }
Out:
{ "result":"..." }