We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

JavaScript Grid - detailData function

I am wondering how I could specify detailData callback function. There is "detailGridData" used in sample what equals to window.detailGridData. Is it possible to bind something like "objectWindow.detailGridData" for this property or something else to avoid global Windows function reference?


1 Reply

MK Maithiliy K Syncfusion Team September 25, 2013 07:32 AM UTC

Hi Ladislav,

 

Thanks for using Syncfusion Products.

 

Query : Is it possible to bind something like "objectWindow.detailGridData" for this property or something else to avoid global Windows function reference?

 

Yes we can bind like "objectWindow.detailGridData" to the "detailData" property. Get the functions as collection of JSON data, and need to attach an event handler function to window object then only we can access the functions within the JSON data. Please refer the below code snippet for more information

 

<script type="text/javascript">

 

   // JSON data

   var detailObject = {

      detailGridData: function (e) {

             . . . . . . .

      . . . . . . .

}

   }

  

  // attach an event handler function to window object

  window.objectWindow = detailObject;

 

  $(function () {

     $("#Grid").ejGrid({      

       . . . . . . .,

      . . . . . . .,        

        detailData: "objectWindow.detailGridData"

       . . . . . . .,             

     });

  });

 

</script>    

 

 

For your convenience we have prepared a simple sample and the same can be downloaded from the following location.

 

Sample link:  DetailTemplate.zip

 

Please try this and let us know if you would require any further assistance.

 

Regards,

Maithiliy K

 


Loader.
Live Chat Icon For mobile
Up arrow icon