Welcome to the nuBuilder Forums!

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

[Added] Subform: onSubformTitleClick()

Information about updates, news, Code Library
admin
Site Admin
Posts: 2813
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

[Added] Subform: onSubformTitleClick()

Unread post by admin »

If the function exists (declared in the form's custom code), it will be run when the user clicks on a subform's column which will sort that column.

By returning false, sorting will not be be performed for all subforms on that form:

Code: Select all

function onSubformTitleClick() {
    return false;
}
To disable sorting only for subform with Id mySubformId:

Code: Select all

function onSubformTitleClick(id, e) {
    return id !== 'mySubformId';
}

To disable sorting for a column with id customer on a subform with Id mySubformId

Code: Select all

function onSubformTitleClick(id, e) {  
    return ! (id == 'mySubformId' && e.currentTarget.getAttribute('data-nu-field') == 'customer')
}
Post Reply