Page 1 of 1

Non deletable subform

Posted: Sat Jan 27, 2018 12:05 am
by Fike
I created a subform and I selected the 'No' Deletable option.

However the checkboxes to delete each row of the subform still appeared.

I modified two lines of the nuform.js file to prevent appearing the delete checkboxes on each subform row, but I don't know if this could affect anything else.

To prevent creating the delete checkboxes I modified line 1188 form:

Code: Select all

nuRecordProperties(SF.forms[c], prefix, rowWidth - 40);
to:

Code: Select all

if(SF.delete == '1') nuRecordProperties(SF.forms[c], prefix, rowWidth - 40);
To reduce the rows width (to remove the space where checkboxes are placed on deletable subforms) I modified line 1106 from:

Code: Select all

rowWidth 			= rowWidth;
to:

Code: Select all

rowWidth 			= rowWidth - 30;
I don't know if checkboxes should just be hidden or if they should be not created for non deletable subforms (as is the case with this modification), so please let me know if I should do it on any other way.

Kind regrads,


Fike

Re: Non deletable subform

Posted: Sat Jan 27, 2018 2:54 am
by admin
Fike,

I think that will work well.

I have added that to the latest build.

Please test it out for us.

Steven

Re: Non deletable subform

Posted: Sat Jan 27, 2018 4:13 am
by admin
Fike,

I had to comment it out for the moment because records won't save properly if delete is set to 1.

You can try it yourself.
comment2.PNG
Steven

Re: Non deletable subform

Posted: Sun Jan 28, 2018 8:32 am
by Fike
Yes, I can see that ... I have been testing some changes and I think I know how to make it work. However I noticed another strange thing with subforms.

I have just pulled the updated files from github and I found this:

When I change a field in a subform and save the form for the first time It works ok. If I change that field a second time (without refreshing the subform) it works ok again. But if I change that field for a third time and save the form the field does not get updated.

I will try to find out first why this happens and then I will test whether the changes to remove the delete checkbox on non-deletable sunforms work ok.

Re: Non deletable subform

Posted: Sun Jan 28, 2018 8:50 am
by toms
Fike wrote: When I change a field in a subform and save the form for the first time It works ok. If I change that field a second time (without refreshing the subform) it works ok again. But if I change that field for a third time and save the form the field does not get updated.
Fike, I confirm this bug.

Re: Non deletable subform

Posted: Sun Jan 28, 2018 11:23 am
by Fike
I will create a new topic describing it.

Kind regrads Toms

Re: Non deletable subform

Posted: Sun Jan 28, 2018 7:13 pm
by admin
.