Hi guys !
Does anyone know how to delete a row in subform whit a custom code ?
Thanks in advance for ur help !
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.
Delete a row in subform
-
- nuBuilder Team
- Posts: 4416
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 472 times
- Contact:
Re: Delete a row in subform
Hi,
A record is deleted when the checkbox on its right is ticked and the main form is saved (but I guess you already know that)
Maybe you can describe in a little more detail what you have in mind?
A record is deleted when the checkbox on its right is ticked and the main form is saved (but I guess you already know that)
Maybe you can describe in a little more detail what you have in mind?
-
- Posts: 45
- Joined: Mon Sep 02, 2019 11:54 am
Re: Delete a row in subform
Like we can add a row in a subform with the Javascript function "nuAddRow()", I would like to remove a row in a subform.
In fact, I would like the removed row in a subform to be added in another subform.
I don't know if it's more clear...
In fact, I would like the removed row in a subform to be added in another subform.
I don't know if it's more clear...
-
- nuBuilder Team
- Posts: 4416
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 472 times
- Contact:
Re: Delete a row in subform
I see. This is going to be tough. Let's say you want to delete the 3rd row. Then you'll have to shift up all subsequent rows to fill the gap.
-
- nuBuilder Team
- Posts: 508
- Joined: Fri Dec 28, 2018 1:41 pm
- Location: Krakow, Poland
- Has thanked: 10 times
- Been thanked: 18 times
Re: Delete a row in subform
Hi,
To modify/delete/move data on the subform you can for example call JS function by the button(s) placed in the subform rows.
To read data from the specific row and run function you can place in the button onclick something like that:
Next from JS script function (knowing record id - or specific values) you can call php procedure and with mysql you can do with your data whatever you want - update record / delete / move between tables etc.
At the end in the php procedure you can force form refresh like:
and the data will be immidiatelly updated/refreshed on your form. You can call as well any specific JS function defined in Header or Custom code JS box.
(the above refresh I use to functions called from the main form - but most likelly it should work from subform as well - but did not test)
To modify/delete/move data on the subform you can for example call JS function by the button(s) placed in the subform rows.
To read data from the specific row and run function you can place in the button onclick something like that:
Code: Select all
var f=nuSubformValue(this, 'your_specific_field_ref'); ... any-JS-functioon...input boxes ... etc.
or
var a = nuSubformValue(this, 'Oferty_id'); .....any JS code .... - ID of record - use your specific ref
At the end in the php procedure you can force form refresh like:
Code: Select all
$s="nuGetBreadcrumb();";
nuJavascriptCallback($s);
(the above refresh I use to functions called from the main form - but most likelly it should work from subform as well - but did not test)
You do not have the required permissions to view the files attached to this post.
If you like nuBuilder, please leave a review on SourceForge