NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: jking on January 24, 2019, 05:50:00 PM

Title: Custom JavaScript functions
Post by: jking on January 24, 2019, 05:50:00 PM
Bruce,

I have the filter you helped me construct, on the JS filter line of my browse:

'return record.type.toLowerCase().indexOf($("#coinSearch").val().toLowerCase()) >= 0 ? recordOk : recordFiltered;'

I want to expand on this browse so I tried putting it into my custom.js file, and calling it from there.  I get errors, see attached image.  The changes I want to make are to filter over more than one field.  For example, filter over Type and Date.  This filter will become larger and more dificult to handle on the template JS Filter entry.  Thus, I want to add it to the custom.js file.  I have tried numerous modifications but keep getting the function error.  Can you help?

Thanks,

Jeff
Title: Re: Custom JavaScript functions
Post by: Bruce on January 28, 2019, 12:08:35 AM
my guess is that record is not in scope here. so pass it as a parameter;

filterCoinBrowse(record)

and then prototype it as

function filterCoinBrowse(record)

cheers
Bruce