Form - Missing Button
Form - Missing Button
Once a record has been added the status is set to Unapproved by default
You then need to select the record, click the Approved button which will popup a different form that allows you to confirm the Supplier and asks you to add the order number.
This works fine however there is no button on the form that allows me to save the changes?
Any help in getting a button to save the form would be greatly appreciated.
http://clipboardplus.co.uk/labdocs.co.uk/labdocs_tracking.html
[code]
// Insert Approved Button Start
{
"sExtends": "editor_edit",
"editor": editorapprove,
"sButtonText": "Approve",
"fnClick": function (button, config) {
var tt = this;
var rows = tt.fnGetSelected();
editorapprove.edit(rows[0], '', [], true);
editorapprove.set('statusID', 'Approved');
editorapprove.set('statusdateID', new Date());
editorapprove.title('Confirm Approved');
editorapprove.submit(function (json) {
tt.fnSelectNone();
});
}
},
// Insert Approved Button End
[/code]
You then need to select the record, click the Approved button which will popup a different form that allows you to confirm the Supplier and asks you to add the order number.
This works fine however there is no button on the form that allows me to save the changes?
Any help in getting a button to save the form would be greatly appreciated.
http://clipboardplus.co.uk/labdocs.co.uk/labdocs_tracking.html
[code]
// Insert Approved Button Start
{
"sExtends": "editor_edit",
"editor": editorapprove,
"sButtonText": "Approve",
"fnClick": function (button, config) {
var tt = this;
var rows = tt.fnGetSelected();
editorapprove.edit(rows[0], '', [], true);
editorapprove.set('statusID', 'Approved');
editorapprove.set('statusdateID', new Date());
editorapprove.title('Confirm Approved');
editorapprove.submit(function (json) {
tt.fnSelectNone();
});
}
},
// Insert Approved Button End
[/code]
This discussion has been closed.
Replies
The third parameter there is specifically removing the buttons in the form (an empty array of buttons === no buttons).
I think you might want to pass in `false` as the fourth parameter to have it not display the form and just submit immediately perhaps?
Allan
My new code as follows still doesn't work and I know I'm missing something stupid.
Also, the form cannot be submitted immediately as a order number needs to be entered at approval
[code] // Insert Approved Button Start
{
"sExtends": "editor_edit",
"editor": editorapprove,
"sButtonText": "Approve",
"fnClick": function (button, config) {
var tt = this;
var rows = tt.fnGetSelected();
editorapprove.edit(rows[0], '', [{
"label": "Submit",
"fn": function () {
editorapprove.submit();
}
}], true);
editorapprove.set('statusID', 'Approved');
editorapprove.set('statusdateID', new Date());
editorapprove.title('Confirm Approved');
// editorapprove.submit(function (json) {
tt.fnSelectNone();
// });
}
},
// Insert Approved Button End [/code]
I know its definitely to do with me stupidly missing the button array originally but I just can't figure it out?
I'll check when I get home from work.
Can't believe I missed it.
Allan