![]() |
jadachDevClub member 11/19/2017 |
Try making the search page as default from the menu. Then move your add new button in the message block. Remove the default message. |
T
|
thamestrader author 11/28/2017 |
In my application I have a Customer List page, which has an 'Add New' button that links to the Add page for the table. I'd like to 'encourage' users to actually do a search for the customer before attempting to add them as a new customer. I thought I could do this by initially hiding the Add New button until a search had been performed. I've got the hide/show of the Add New button working using the following code in the JavaScript Onload event for the List page. var id = "addButton"; var button = $("[id^=" + id + "]"); Runner.addDisabledClass(button); if (proxy.Show_Button == true) { Runner.delDisabledClass(button); } Does any one have any thoughts on whether there is a better way to do this please?
|
T
|
thamestrader author 11/28/2017 |
** Update * The above code did change the button background colour, but the link was still active. I tried adapting the code from the Save Confirm example Runner.delDisabledClass(pageobj.saveButton); i.e. Runner.delDisabledClass(pageobj.addButton); This didn't do anything. So then I tried: document.getElementById("addButton1").disabled = false; This did disable the button, but the colours were unchanged. Slowly getting there. Further update.. What I've got working requires a combination of the PHPRunner code and the raw JS. Runner.addDisabledClass(pageobj.addButton); // to manage the colours document.getElementById("addButton1").disabled = true; // to actually disable And to re-enable the button with the correct colours. Runner.delDisabledClass(pageobj.addButton); // to manage the colours document.getElementById("addButton1").disabled = false; // to actually enable Possible not the most elegant, but it seems to be working as I require for disabling/enabling.
|
T
|
thamestrader author 11/29/2017 |
Try making the search page as default from the menu. Then move your add new button in the message block. Remove the default message. This way users go to search first, and only when no results show, they can add new.
|
T
|
thamestrader author 12/1/2017 |
|