Skip to content

check all checkbox

New Discussion
Sathya Rajagopal
Sathya Rajagopal asked on Jan 13, 2016 8:45 AM

Hi experts,

I have a Lock column shows checkboxes and it’s underlying datasource is of bool type. Is there a good way to add a checkbox at column header, and if I check that box, all checkboxes in that column should be checked?

Option 2, if there is no such way. Is there a way to manually modify the datasource of iggrid, set the all lock to true via javascript, so that I can rebind the all checked datasource to grid again?  Does iggrid provide such kind of api to do that?

 

Sign In to post a reply

Replies

  • 0
    [Infragistics]Tsanna
    [Infragistics]Tsanna answered on Jan 11, 2016 9:46 AM

    Hello srajagopal,

    I would suggest you to use igGrid Row Selectors feature in order to achieve "select all" functionality. Here is a jsFiddle link that demonstrates a sample with such functionality for your reference: http://jsfiddle.net/gwds7bh9/ If I can provide you with further assistance, please let me know.

    Regards,

    Tsanna

    • 0
      Sathya Rajagopal
      Sathya Rajagopal answered on Jan 11, 2016 4:41 PM

      Hello Tsanna, thank you for your reply. My lock column is binding to an underlying datasource column, I enabled updating feature, so the lock column is actually a editable column. Row selector just gives a way to select rows, but cannot edit it's datasource. Is there a way to check a header checkbox and then all checkboxes are checked, and datasource are updated? 

      • 0
        [Infragistics]Tsanna
        [Infragistics]Tsanna answered on Jan 12, 2016 1:56 PM

        Hello srajagopal,

        I created a sample with similar scenario for your reference. Please check it and let me know if it helps you resolving your issue.

        Regards,

        Tsanna

      • 0
        Sathya Rajagopal
        Sathya Rajagopal answered on Jan 12, 2016 3:10 PM

        that's a smart solution! But it works only on the first page?

      • 0
        [Infragistics]Tsanna
        [Infragistics]Tsanna answered on Jan 13, 2016 8:45 AM

        Hi,

        If you want to select across all pages, then you need to loop through the whole data source, for example:

        for(var i = 0; i < adventureWorks.length; i++)
               {
                rowId = adventureWorks[i].ProductID;
                $("#grid").igGridUpdating("setCellValue", rowId, "MakeFlag", true);
               }

        Another approach to get the datasource records is: $("#grid").data("igGrid").dataSource.data().length

        If you have further questions, please let me know.

        Regards,

        Tsanna

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Sathya Rajagopal
Favorites
0
Replies
5
Created On
Jan 13, 2016
Last Post
10 years, 2 months ago

Suggested Discussions

Tags

Created by

Created on

Jan 13, 2016 8:45 AM

Last activity on

Mar 5, 2026 2:23 PM