I just started experimenting with JS API. I was able to change "Metadata" and "Asset Status" of some assets (pages) successfully.
I was wondering if its possible to switch/change class applied to a div using JS API. I tried using setContentOfEditableFileAsset function.
I am not sure how to specify the "content":"content of file" parameter of this function ?
I am using this code :
function matrixSetContent() { js_api.setContentOfEditableFileAsset({ "assetID":"38963", "content":"content of file", "dataCallback":function() { alert("Class updated successfully")} }) }
Here is the error I am getting, taken from console:
Uncaught Required argument "asset_id" missing gscope.Squiz_Matrix_API._options gscope.Squiz_Matrix_API.setContentOfEditableFileAsset matrixSetContent onclick
I am not even sure if setContentOfEditableFileAsset function is the correct function to use for this requirement (changing class)...!
Any help is highly appreciated.
Thanks