Disabling button when no record is selected |
10/24/2022 7:39:53 AM |
PHPRunner General questions | |
![]() Hi, I try to follow this tip http://asprunner.com/forums/topic/25588-disabling-a-custom-button-till-some-records-are-selected/ to hide or show a custom buttom when records are selected or not. It works as long as there are no additional where tabs. If there are and I switch to another then the first tab, the code does not work, the button stays disabled no matter if or how many records are selected. Any ideas? |
|
![]() |
Sergey Kornilov admin 10/24/2022 |
I see not reason for this code not to work in this scenario. I guess you need to use Chrome Developers Tools to step through the code and see what is executed and when. Just a question, do you use 'AJAX search and pagination' option for this page? |
![]() |
mbintex author 10/24/2022 |
yes I do |
![]() |
mbintex author 10/24/2022 |
After turning off "ajax pagination" it works. But why. "Update selected button" gets turned on and off with Ajax ... would be happy, if that worked for Custom buttons too |
![]() |
Sergey Kornilov admin 10/24/2022 |
The code is implemented via Javascript OnLoad event which is executed on the page load. If you use AJAX option, the page doesn't get reloaded and this code is not executed again. Just the way how things work. |
![]() |
mbintex author 10/24/2022 |
by the way. With changing the code to var selectedRecords = pageObj.getSelectedRecords(); I don“t have to look in Google Chrome inspector for the ID, but can use the ID I set in Page Designer. |
![]() |
mbintex author 10/24/2022 |
Just the way how things work. OK, but what do you do with "Update selected" and "Delete" buttons that it works there? |