attaches the specified URL to a cell

void attachURL(string url, [boolean ajax,boolean|object postData] );


urlstringURL to attach
ajaxboolean(optional) if set to true, the URL will be loaded by AJAX (async GET), false by default
postDataboolean|object(optional) performs POST request (true for a simple post or an object with params)


/* iframe */
// GET
dhxComponent.cells(id).attachURL("page.html", null, true);
// POST with params
dhxComponent.cells(id).attachURL("page.html", null, {fname: "Mike", hobby: "fishing"});
/* by ajax */
// GET
dhxComponent.cells(id).attachURL("page.html", true);
dhxComponent.cells(id).attachURL("page.html", true, true);
// POST with params
dhxComponent.cells(id).attachURL("page.html", true, {fname: "Mike", hobby: "fishing"});


important notes:

  • to prevent caching in some browsers, an extra param like "dhxr0123456789" will be added
    (to disable the extra param set dhx.ajax.cache = true, please check details here)
  • loading is async, so to proceed with content, you need onContentLoaded event
  • learn how to control attached content here
Change log

postData param and the ability to perform POST request are added in version 4.0

Back to top