Check documentation for the latest version 6.0 of dhtmlxSuite attachURL DHTMLX Docs

attachURL

attaches the specified URL to a cell

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

Parameters

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)

Example

/* iframe */
// GET
dhxComponent.cells(id).attachURL("page.html");
// POST
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);
// POST
dhxComponent.cells(id).attachURL("page.html", true, true);
// POST with params
dhxComponent.cells(id).attachURL("page.html", true, {fname: "Mike", hobby: "fishing"});

Details

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