Different oLanguage strings dependent on variable value
Different oLanguage strings dependent on variable value
Is there a way I can change one of the language strings (sZeroRecords) dependent on the value of a variable?
I the table is designed to show child records associated with a parent record , so I want to differentiate between the parent record not being saved yet (parent record id=0 and no child records returned), and no child record being created (parent record id > 0 and no child records returned).
I've tried:
[code]
"oLanguage": function () {
if (iOrderId > 0) {
oLanguage.push ( {"sZeroRecords": "No items on this order."} );
} else {
oLanguage.push ( {"sZeroRecords": "The parent record is an unsave new record. Save it before adding items." } );
}
},
[/code]
but it just results in the default language string being displayed (doesn't throw any errors).
Any ideas?
I the table is designed to show child records associated with a parent record , so I want to differentiate between the parent record not being saved yet (parent record id=0 and no child records returned), and no child record being created (parent record id > 0 and no child records returned).
I've tried:
[code]
"oLanguage": function () {
if (iOrderId > 0) {
oLanguage.push ( {"sZeroRecords": "No items on this order."} );
} else {
oLanguage.push ( {"sZeroRecords": "The parent record is an unsave new record. Save it before adding items." } );
}
},
[/code]
but it just results in the default language string being displayed (doesn't throw any errors).
Any ideas?
This discussion has been closed.
Replies
It is a nice idea for future though!
Allan
Thanks.