Onchange event of checkbox

Onchange event of checkbox



I have added one checkbox in header of TableRecords widget and that checkbox is bound to Local boolean variable.

Onchange event of checkbox I am assigning True value to boolean variable of TableRecords and after that refreshing the table but still I am not able to see that my checkbox is marked as selected.

Please advice.

Thanks and Regards,

Suraj Borade

Hi Suraj,

When you refresh a TableRecords, it is rebound to the original list. In your case, this means it overwrites the changes you made.

May I ask why you are not using the RichWidget's Input_BulkSelect?

Hi Sir,

I have applied pagination. So when I use RichWidget's Input_BulkSelect only records from that page gets selected and my Export To Excel link gets enabled. On that link, I am exporting records to excel which are selected.

My requirement is that when I select all records, all records from database should be exported to excel and not from that particular page and RichWidget's Input_BulkSelect only allows to select records from particular page.

Do you have any suggestions for this use case?


Suraj Borade

Hi Suraj,

It's in general bad UI design if you export what a user clicked three pages ago, since they won't recall what they did (typically, at least). However, I've dealt with such a requirement before (although not for exporting, if you want to export all, just have an "Export All" button). As I said, when refreshing the TableRecords widget, it rebinds to the source list. This means that any changes you want to keep when changing the page, you need to update in your original list.

The index of the first row in your TableRecords can be got using List_Navigation_GetStartIndex(). Next, you are going to loop over your TableRecords list, keeping track of the Index and copy whatever you need to copy to the original List using indexing (SourceList[Index].MyAttribute = TableRecords1.Current.MyAttribute etc.).

In your case, if you just want to set all records to checked, just loop over the source list, set the check boolean to True, and refresh the TableRecords

Hi Suraj,

As suggested by Kilian sir, "Export All" button will be a good option.

Thank you,