Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var lookupId = "lookupInvoice";
- var dateOnlyFieldIndexes = "1,3"; // this is the indexes of the date column(s) in the lookup
- ScriptManager.RegisterStartupScript(this, GetType(), "script_CustomizeInvoiceLookup", @"
- require(['dojo/aspect', 'Sage/UI/SDataLookup'], function(aspect, SDataLookup) {
- aspect.after(SDataLookup.prototype, '_formatStructure', function() {
- if (this.id.indexOf('%LOOKUP%') !== -1)) {
- var colIndexes = '%INDEXES%'.split(',');
- for(var i = 0; i < colIndexes.length; i++) {
- var col = this.structure[parseInt(colIndexes[i].trim())+1];
- if (col) col.dateOnly = true;
- }
- }
- });
- });
- ".Replace("%LOOKUP%", lookupId).Replace("%INDEXES%", dateOnlyFieldIndexes), true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement