Questions tagged as 'underscore.js'

1
answer

Sort decimal notes

I am ordering a related json in notes in undescore.js {8.0 , 8,5 , 5,5 } var asc = _.sortBy(oper, function(num) { return num.nota; }); 8.8 6.0 5.5 10.0 0.0 How do I make him unde...
asked by 31.03.2015 / 17:11
1
answer

Is it possible to load undescore templates externally with javascript?

Generally, I use Template Engines to render HTML via JavaScript. Usually use undescore.js . I really like this way of making it easier to create HTML with Templates. Example: Somewhere in HTML: <script type="text/template"...
asked by 02.10.2015 / 18:12
1
answer

Regular expression search

I'm trying to do a search with regular expressions in an immense json this way: json = _.filter(dados.responseJSON,function(rst){ return /rst.dst/m == tel }); But it is not working. The goal is to make the search as if it were L...
asked by 11.03.2015 / 19:40
1
answer

Filter by multidimensional objects with underscore.js

How do I filter objects by attribute operations inside json? var data = Object entrada_diff: "00:00:00" entrada_hoje: "00:00:00" entrada_jornada: "08:00:00" entrada_status: "PENDENTE" funcionario_cpf: "06547457656" funcionario_cracha: "10703"...
asked by 09.12.2014 / 21:15
1
answer

(BackboneJS) Run a View after return from the server

In my application I have 2 Views . One of them is sending the data to the server when the client clicks on submit . The other needs to wait for this response and run to work with the 'upgraded' data. How would I do such a thing?     
asked by 18.08.2015 / 20:02
1
answer

Underscore JS, Group array of objects by more than 1 attribute contained in an object

Currently I have an array object that contains the following structure { "ID_Local_leitura": "2134236478dysa743242579f", "idO": "11342s36478dysa743242579", "timeStamp": "2016-11-11T02:00:00.000Z", "quantidadeAnimais": 50, "tipoDeAnim...
asked by 28.11.2016 / 13:59
1
answer

Notification system, _.template (...) .html is not a function

I am making a notification system and am getting the following error: Uncaught TypeError: _.template(...).html is not a function Here is the code: <script type="text/x-template" id="notifications-template"> <ul> &l...
asked by 01.11.2016 / 17:33