Angular ui.grid getting filtered dataset - angularjs

I m actually trying to developp a little application using de ui.grid library and I m facing problems when getting the data result set on a filter.
In fact, everything works great, I can filter, I can make opération on each line, but I cant get the full result set of a filter using :
http://ui-grid.info/docs/#/tutorial/103_filtering
Can you help ?
I repeat : everything works great, I can sort and filter, but I cant get my resultset
Thanks for advance & have a nice day ! :D

What do you mean by "get my resultset"?
I'm assuming this means you want to programmatically get at the filtered list of rows. ui-grid doesn't provide an API for doing that, but you can get it from gridApi.grid.renderContainers.body.visibleRowCache. This will give you a list of the current visible rows.
You can extract the original entities from your data array from those rows, the entity is typically in row.entity.

Related

angular material md.data.table pagination issue

I'm using the md.data.table to display data that I get from the backend,
there is a lot of data (~40000 row) so I'm using backend pagination like this:
in the fist time I get 100 row from the backend so with a limit of 10, the user can navigate in the first 10 pages, when he ask for a page in [11,20](for example) a new request is sent to get the newt 100 rows, and so on.
my problem is that when I get a new 100 rows from the backend (for example the user select the 11th page) I get the result but the page number return to 1 I tried to set it manually using : paginationParams.page=11 but it doesn't work
can anyone help.
thank you in advance :)
I find the solution my self, and here is the solution for those who will have the same issue
the problem was that when I send the request the get the next 100 rows, I copy it in the variable used to show the first 100 rows.
so the solution is, instead of copy the result in the variable, I add them to it, and that solve the problem

How to include OR condition in HTTP request to an API?

I am wondering if it was possible to include a "OR" condition in a URL request.
In my case, I would like to have the list of items which have been created or updated between two dates. (Assuming that items that have been created before these dates but updated during these dates interest me!).
I tired lot of syntax but can't find the right way to do so..
I wrote the following code to make my problem more understandable.
api/items/search/?query=(created_on_from=2015-05-09&created_on_to=2015-10-
09)OR(updated_on_from=2015-05-09&updated_on_to=2015-10-09)
Thanks a lot !

Issues on a select with AngularJS and Google Spreadsheet

I want to create a small web app which would display a list of movies, with a Google spreadsheet set as a database. So far, I was able to connect my spreadsheet to my app and I also added some filters to it. (As a side note, this thread really helped me in the process.)
Here is a very simplified version of my app: http://plnkr.co/edit/BtbSCVOh7KJsMHjANxMP?p=preview
I still have 3 problems with my <select>, which I can't fix despite trying for hours:
I can't sort my <options> alphabetically. Trying with orderBy didn't return anything.
I can't figure out a way to split my categories when there are more than one for a movie.
If the "categorie" field in my spreadsheet is empty, it will return a blank <option> which I would like to remove or hide.
My guess is that I'll need to update my function one way or another, but I'm a bit lost at the moment.
Any help on this would be really appreciated!

NG-Grid Filter not working correctly

I have a really basic grid using Angular.js and NG-GRID with the showFilter: set to true.
However if I search for the value in the Marketing Start Date Column, 200101011. It doesn't show. Actually as soon as I start typing a 2 in the filter text it should find all four records, but only 2 show up....
Here's the Plnkr
http://plnkr.co/edit/D3nFkQ
Thank you.
The problem appears to be the null values in your table. The search does not seem to go past a cell containing null. Hence the strange filtering behaviour. If you replace the nulls with empty strings or other values the search works perfectly.
There is an issue logged on ng-grid on GitHub - filter search box returns prematurely when cell contains an object. Since null is an object the solution suggested may work for you.

angularjs ng-grid computed column

I'm trying to emulate a spreadsheet using AngularJS and ng-grid. My needs are simple but I cannot find anything anywhere that will help me fix my code.
I have a simple table of scores and in the last column I need a "Total Score" column.
You can see my code at this plunk.
My problem is that though I was able to get the total in each row on document.load, I cannot make the "Total" column update whenever any of the scores are changed.
Or alternatively, you could add the getTotal() function directly to the model object:
http://plnkr.co/edit/LhlK1C?p=preview
I prefer solutions where I don't have to work with $watch(), but it depends if you want the total to be stored in your model or only need it for display.
You could watch for changes to the 'original_data' object and recreate the process_data object every time updates.
http://plnkr.co/edit/c4iynItnznKNRoFgeuio?p=preview

Resources