Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
igTreeGrid check checkboxes onload
posted

Hello community,
I have searched a long time, but can't find a solution for it.

I am loading a igtreegrid with a remote datasource (rest), i want to check some of the checkboxes when the data is loaded.
For this i found some examples like this:

//Initialize $(".selector").igTreeGrid({ dataRendered: function(evt, ui) { $("#myTreeGridId_table").igTreeGridRowSelectors("toggleCheckStateById","my-id"); } });


The problem seems to be that the dataRendered function is triggered to earl, no data is there to manipulate.
When I use the "toggleCheckStateById" function in the chrome debugger it is working, and dataRender function is also triggered.

What is the easiest way to check the checkboxes? Is there a way to pass the ids for some rows which should be checked? or is there a function which is called after the data is shown?

I also tried already this event: rowsRendered
With the some problem like dataRendered.

Another thing is, i m loading the data on demand (AppendRowsOnDemand), I need also a trigger when this data is complete.

I would be very thankful for each hint

Best regards 

Parents
  • 345
    Offline posted

    Hello Michael,

     

    Thank you for posting in our forum.

    The API exposes the setCellValue method that could be used to set a new value to a given cell – you could use it to check the checkboxes you want. More information may be found here:

    https://www.igniteui.com/help/api/2017.2/ui.iggridupdating#methods:setCellValue

    Loading the remote data is an asynchronous operation and the time needed for it to finish may vary. That’s why the grid renders itself first, and then fills in the data, once it gets it from the remote endpoint.

     Instead of dataRendered, you could use the igTreeGrid dataBound event, which gets fired after data binding is complete. Inside its callback you have a reference to the dataSource and could check to see if the data was loaded.

    The igTreeGrid doesn’t support AppendRowsOnDemand, but it inherits it from the igGrid, so please note that if you use it, some unexpected behavior or issues may occur.

    If you need any additional assistance, feel free to contact me.

     

     

    Best Regards,

    Vasil Pavlov

    Associate Software Developer

    Infragistics, Inc.

Reply Children