EloquentStudio / filter.js

Complete solution for client side filtering and rendering using JSON data
http://eloquentstudio.github.io/filter.js
MIT License
664 stars 183 forks source link

ASP.NET Web Forms issue with syntax #147

Open partynikko opened 7 years ago

partynikko commented 7 years ago

Eager to use this plugin together with ASP.NET Web Forms, there's an issue where the view syntax <%= var %> won't work as it shares the syntax with ASP.NET Web Forms and thus it's not possible to write the view HTML in the ASP.NET project.

In Underscore.js you can define your own template settings and thus change the syntax to make it work with ASP.NET.

How do you recommend us to work around this?

Thanks & Best Regards

jiren commented 7 years ago

Need to edit code of view template.

//View Template
 var templateSettings = {
    evaluate    : /<%([\s\S]+?)%>/g,
    interpolate : /<%=([\s\S]+?)%>/g,
    escape      : /<%-([\s\S]+?)%>/g
  };

Set it to

 var templateSettings = {
    evaluate    : /{{([\s\S]+?)}}/g,
    interpolate : /{{=([\s\S]+?)}}/g,
    escape      : /{{-([\s\S]+?)}}/g
  };
partynikko commented 7 years ago

@jiren Thank you for your reply. However I don't feel like I'd like to change the code in the library in case of future updates. Do you have any plan on implementing a function for setting the hooks/syntax?