This topic contains 1 reply, has 2 voices, and was last updated by Sean Sean 2 years, 4 months ago.

datatable.js, use same instance in different files …


  • michelmarroche
    Participant

    Posts: 5
    Member Reply #5715

    Hi, i need use same datatable object or instance in different javascript files … One create and initialize datatable … And another file is for advanced search using your custom functions as “setAjaxParam” “submitFilter” “clearAjaxParams” etc …

    How call existing “grid” instance of object from another javascript file ?

     

    I have for example in first file …


    var grid = new Datatable();
    grid.init({ ...

    How to call this grid object or instance from another file ?

     

    Thanks,

     

    Sean
    Sean
    Keymaster

    Posts: 4527
    Support Staff Reply #5725

    Hi,

    You just need to expose “<span style=”color: #555555; font-family: Menlo, Monaco, Consolas, ‘Courier New’, monospace; line-height: 12.8px; white-space: pre-wrap;”>grid” variable to global scope and access from any js script.
    If you need any further clarifications please let us know.</span>

    Thanks.

Tagged: 

You must be logged in to reply to this topic.