Ajax Calls
In:
{ "method":"loadGrid", "params":[GRIDID] }
Out:
{ "result" : { "container" : [ { "containerid" : "1", "epilog" : "Dies ist der Epilog", "prolog" : "Dies ist der Prolog", "readmore" : "Weiterlesen", "readmoreurl" : "http://www.google.com/", "slots" : [ { "boxes" : [], "id" : "1" } ], "style" : null, "title" : "Bild Header", "titleurl" : "http://www.google.com/", "type" : "C-12" }, { "containerid" : "2", "epilog" : "Dies ist ein Twitter Epilog", "prolog" : "Dies ist ein Twitter Prolog", "readmore" : "Weiterlesen", "readmoreurl" : "http://www.app.net/", "slots" : [ { "boxes" : { "boxid" : "2", "content" : "Dies ist ein divDies ist ein P
Dies ist ein Span", "epilog" : "Epilog", "language" : null, "layout" : null, "prolog" : "Prolog", "readmore" : "Weiterlesen", "readmoreurl" : "http://www.github.com/benthebear/issues", "style" : null, "title" : "Boxtitel die Zweite", "titleurl" : "http://www.github.com/benthebear/grid", "type" : null }, "id" : "2" }, { "boxes" : [], "id" : "3" } ], "style" : null, "title" : "Artikel und Twitterbox", "titleurl" : "http://www.twitter.com/", "type" : "C-8-4" }, { "containerid" : "3", "epilog" : "Dies ist der Epilog", "prolog" : "Dies ist der Prolog", "readmore" : "Weiterlesen", "readmoreurl" : "http://www.facebook.com/", "slots" : [ { "boxes" : [], "id" : "4" }, { "boxes" : [], "id" : "5" } ], "style" : null, "title" : "Twitterbox", "titleurl" : "http://www.facebook.com/", "type" : "C-4-8" } ], "id" : 42, "isDraft" : true, "isSidebar": bool } }
In:
{ "method": "addContainer", "params": [GRIDID,TYPE,IDX] }
Out:
{ "id" : CONTAINERID, "slots" : [SLOTID,...] }
In:
{ "method" : "moveContainer", "params" : [GRIDID,CONTAINERID,NEWIDX] }
Out:
{ "result" : true }
In:
{ "method" : "deleteContainer", "params" : [GRIDID,CONTAINERID] }
Out:
{ "result" : true }
In:
{ "method":"updateContainer", "params": [ GRIDID, CONTAINERID, { "style":"asdf", "title":"Bar", "titleurl":"http://", "readmore":"....", "readmoreurl":"...", "prolog":"...", "epilog":"..." }] }
Out:
{ "result":true }
In:
{ "method":"get*Styles", "params":[] }
Wichtig: statt * einfach Container, Slot oder Box einsetzen!
Out:
{"result":[{"title":"freeform","slug":"freeform"},{"title":"vipslot","slug":"vipslot"},{"title":"Voll k\u00e4siger Style","slug":"voll-kaesiger-style"}]}
In:
{ "method":"moveBox", "params":[GRIDID,OLDCONTAINERID,OLDSLOTID,OLDIDX,NEWCONTAINERID,NEWSLOTID,NEWIDX] }
Out:
{"result":true}
In:
{ "method":"removeBox", "params":[GRIDID,CONTAINERID,SLOTID,IDX] }
Out:
{"result":true}
In:
{ "method":"updateSlotStyle", "params":[GRIDID,CONTAINERID,SLOTID,SLOTSTYLE_AS_STRING] }
Out:
{"result":true}
In:
{ "method":"getMetaTypesAndSearchCriteria", "params":[] }
Out:
{ "result":[ { "type":"content", "title":"Inhalte", "criteria":["title","body"] }, { "type":"lists", "title":"Listen", "criteria":"["title"] }, { "type":"static", "title":"Statischer Inhalt", "criteria":[] } ] }
In:
{ "method":"Search", "params":[METATYPE,SEARCHSTRING,CRITERIA] }
Out:
{ "result":[ BOX_WITHOUT_ID, BOX_WITHOUT_ID ] }
Important: Boxes have "Content" which is JSON - this JSON is needed upon creating the box.
In:
{ "method":"CreateBox", "params":[GRIDID,CONTAINERID,SLOTID,IDX,BOXTYPE,CONTENT] }
Out:
{ "result":FULL_BOX_INCLUDING_ID }
Important: BOXTYPE is the type of the box as returned in search result - not the box meta type.
In:
{ "method": "UpdateBox", "params": [GRIDID,CONTAINERID,SLOTID,IDX,BOXDATA] }
BOXDATA is an object containing:
- title
- titleurl
- style
- prolog
- epilog
- readmore
- readmoreurl
- content
Content is structured according to the box' type.
Out:
{"result":true}
In:
{ "method":"publishDraft", "params":[GRIDID] }
Out:
{ "result":true }
In:
{ "method":"revertDraft", "params":[GRIDID] }
Out: If everything went well: see loadGrid Else:
{ "result":false }
In:
{ "method":"Rights", "params":[] }
Out:
{ "result":[ "create-container", "edit-container", "delete-container", "move-container", "create-box", "edit-box", "delete-box", "move-box" ] }
This is the maximum result - the returned list of Rights the user has will be shorter according to the CMS' configuration.
Moved to: https://github.com/palasthotel/grid/wiki/Ajax-Boxeditor#in-box-editor-search
Moved to: https://github.com/palasthotel/grid/wiki/Ajax-Boxeditor#typeaheadgettext
In:
{ "method":"reuseBox", "params":[GRIDID,CONTAINERID,SLOTID,IDX] }
Out: upon moving the box to the reuse world, a new box is returned as a replacement. See createBox (for example) for the detailed return.
In:
{ "method":"reuseContainer", "params":[GRIDID,CONTAINERID,ADMINTITLE], }
Out: This Operation has severe results - a full page refresh is needed to restabilize.
In:
{ "method":"getReusableContainers", "params":[] }
Out:
{ "result":[FULLCONTAINER] }
FULLCONTAINER is a fully fledged container - see loadGrid for a sample.
In:
{ "method":"addReuseContainer", "params":[GRIDID,IDX,REUSEID] }
Out:
{ "result":{FULLCONTAINER} }
FULLCONTAINER is a fully fledged container - see loadGrid for a sample.
In:
{ "method":"getContainerTypes", "params":[] }
Out:
{ "result" : [ { "numslots" : "1", "type" : "C-12" }, { "numslots" : "3", "type" : "C-4-4-4" }, { "numslots" : "2", "type" : "C-8-4" }, { "numslots" : "2", "type" : "C-4-8" }, { "numslots" : "6", "type" : "C-2-2-2-2-2-2" }, { "numslots" : "1", "type" : "C-4" }, { "numslots" : "2", "type" : "C-0-4-4" }, { "numslots" : "2", "type" : "C-4-4-0" }, { "numslots" : "1", "type" : "C-0-8" }, { "numslots" : "1", "type" : "S-0-4" }, { "numslots" : "1", "type" : "S-4-0" }, { "numslots" : "1", "type" : "C-8-0" }, { "numslots" : "0", "type" : "C-0" }, { "numslots" : "1", "type" : "C-0-4-0" } ] }
What do you need? I Guess at least the Grid-ID In:
{ "method":"getRevisions", "params":[GRID_ID] }
Out:
{ "result": [ { "number":4, "state":"draft", "editor": "Edward", "date":"16.08.2013", "url": "http://preview.de" }, { "number":3, "state":"published", "editor": "Edward", "date":"12.08.2013", "url": "http://edwardbock.de" }, { "number":2, "state":"depreciated", "editor": "Enno", "date":"11.08.2013", "url": "http://enno.de" }, { ...more of state... "state":"depreciated" } ] };