Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

When delete checkbox checked...

Questions related to using nuBuilder Forte.
Post Reply
amit
Posts: 36
Joined: Sat Jun 02, 2018 1:26 pm

When delete checkbox checked...

Unread post by amit »

HI,

If the delete checkbox is check in a subgrid, I want the corresponding line to be hightlighed red and and also disabled. That makes it easier to visually see that a line is marked for deletion. Is it possible to do this with JavaScript?
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: When delete checkbox checked...

Unread post by admin »

amit,

A Lookup Object has a clickdelete event.

https://wiki.nubuilder.cloud/ ... ustom_Code

Try changing background color here.


Steven
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: When delete checkbox checked...

Unread post by kev1n »

As Steven suggested, add a clickdelete event to your Subform Object.
deleteClicked.jpg
Then, in your Form's Custom Code field add this JavaScript to cross out and turn the text red of a row that is marked to delete:

Code: Select all

function deleteClicked(event) {

    var id = event.target.id;
    var sf = "sfObj"; //<----- replace with your Subform Object ID !

    var row = id.substring(sf.length, sf.length + 3);
    style = $('#' + id).is(":checked") ? {
        'color': 'red'
        , 'text-decoration': 'line-through'
    } : {
        'color': 'black'
        , 'text-decoration': 'none'
    };

    $('[id^=' + sf + nuPad3(row) + ']').css(style);

}
subform_strike_through.gif
You do not have the required permissions to view the files attached to this post.
Post Reply