Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Add 2 button to the rows of the browse form
-
- Posts: 6
- Joined: Thu Mar 30, 2017 12:14 am
Add 2 button to the rows of the browse form
hi, is there the possibility to add 2 buttons to the rows of the browse form?
I would like to press the first button to open the edit form of the selected record, pressing the second to open another form browse with the records related to the selected record
I would like to press the first button to open the edit form of the selected record, pressing the second to open another form browse with the records related to the selected record
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Add 2 button to the rows of the browse form
Hi,
Are you familiar with JavaScript?
There's an article in the Code Library that shows how to add a button to each row of a Browse Form:
https://github.com/smalos/nuBuilder4-Co ... te_buttons
Are you familiar with JavaScript?
There's an article in the Code Library that shows how to add a button to each row of a Browse Form:
https://github.com/smalos/nuBuilder4-Co ... te_buttons
Re: Add 2 button to the rows of the browse form
calida,
If you know Javascript this might help.
It adds an Edit Button to the first column of a Browse/Lookup.
Steven
If you know Javascript this might help.
It adds an Edit Button to the first column of a Browse/Lookup.
Code: Select all
for(var i = 0 ; i < 20 ; i++){
if($('#nucell_' + i + '_1').html() != ''){
$('#nucell_' + i + '_0').html('<input type="button" id="edit' + i + '"class="nuActionButton" value="Edit" onclick="editBuildType(event)">');
}
}
function editBuildType(e){
var p = e.target.id.substr(4)
$('#nucell_' + p + '_0').prop("onclick", null).off("click");
var pk = $('#nucell_' + p + '_0').attr('data-nu-primary-key');
nuForm('600cc03b4195b7f', pk, '', '', '1');
}
Steven
A short post is a good post.
-
- Posts: 249
- Joined: Sun Dec 06, 2020 6:50 am
- Location: Chennai, India, Singapore
Re: Add 2 button to the rows of the browse form
Should we not have a button on the form designer to add buttons with standard options like Delete, Edit, Popup (with parameters), etc - a sort of a wizard or standard form to add them in?
This way we can leverage some standard functions to generate them instead of custom JS each time.
This way we can leverage some standard functions to generate them instead of custom JS each time.
Re: Add 2 button to the rows of the browse form
Great Idea! Also How can I either disable or delete a button once I add it.apmuthu wrote:Should we not have a button on the form designer to add buttons with standard options like Delete, Edit, Popup (with parameters), etc - a sort of a wizard or standard form to add them in?
This way we can leverage some standard functions to generate them instead of custom JS each time.
I have a form that all fields are disabled when you first open it (view only). For example: I have a function that deletes the clone button, via: $('#nuCloneButton').hide(); Then I add two buttons: One to duplicate the current record and one to just edit the current record.
nuAddActionButton('DupMyForm', 'Duplicate MyForm', 'clearFields("cust_billdate|cust_retdate")');
nuAddActionButton('EditMyForm', 'Edit MyForm', 'clearFields("NO")');
My clearfields() function will either clear out some fields after I click DupMyForm or NOT if I just click the EditMyForm button.
If I click my DupMyForm Button, I'd like to disable it afterwards or hide it. Same with the Edit Button. Don't want the user to get to click happy.
Doing this: $('#DuMyForm').hide(); OR nuDisableAllObjects(); OR nuDisable('DupMyForm'); does not work to disable the buttons.
Also, I'd like to add a Title to the page that Shows Im "Editing" or Duplicating" so the user has an idea what they clicked. Any IDea how to do that would be appreciated.
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Add 2 button to the rows of the browse form
Use nuDisable() to disable objects.
Where should this "Title" be displayed?
Where should this "Title" be displayed?
Re: Add 2 button to the rows of the browse form
Kevin, I've tested with nuDisable(): "Doing this: $('#DuMyForm').hide(); OR nuDisableAllObjects(); OR nuDisable('DupMyForm'); does not work to disable the buttons. "kev1n wrote:Use nuDisable() to disable objects.
Where should this "Title" be displayed?
As with any web page, usually a page has a text title. I'd like it to appear on the Form just above the fields on the page. I could do it with a <div> on the Form page itself and just hide or display it using java script on a regular web page. BUt I don't know how to put a text field (not one that needs to be saved in the dB) on the form itself.
Any ideas would be helpful...
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Add 2 button to the rows of the browse form
To disable the save button:
To disable the clone button:
To disable the delete button:
Code: Select all
nuDisable('nuSaveButton');
Code: Select all
nuDisable('nuCloneButton');
Code: Select all
nuDisable('nuDeleteButton');
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Add 2 button to the rows of the browse form
Just create a new object to the form an give it any ID.icoso wrote: BUt I don't know how to put a text field (not one that needs to be saved in the dB) on the form itself.
Where exactly should this title appear? At position 1,2,3 or somewhere else?icoso wrote:As with any web page, usually a page has a text title. I'd like it to appear on the Form just above the fields on the page.
You do not have the required permissions to view the files attached to this post.
Re: Add 2 button to the rows of the browse form
I should be able to put a title or text object on the form itself that is not associated with a DB field that I can hide or unhide or change appropriately.
But if they click duplicate:
"You have DUPLICATED AN EXISTING RECORD. YOu must change the Billing & Filing Date and click SAVE to save your changes or EXIT to NOT save your changes."
Its just a text box on the form to use as an instructional thing as the user does something.
I tried just adding a display field but it wants an ID that attached to the database.
With a Javascript <div id=whatever> I can typically hide or unhide it using javascript. I just want to display something on the screen when the user is either EDITING or has CLONED a RECORD. This is just to warn them that Hey you're changing something and need to save it or exit out. For example: If the user is looking at a display only form and hits Edit then I want this title to appear and state: "You ARE EDITING AN EXISTING RECORD. Make your changes and click SAVE to save your changes or EXIT to NOT save your changes."But if they click duplicate:
"You have DUPLICATED AN EXISTING RECORD. YOu must change the Billing & Filing Date and click SAVE to save your changes or EXIT to NOT save your changes."
Its just a text box on the form to use as an instructional thing as the user does something.
You do not have the required permissions to view the files attached to this post.