How can I add slickgrid checkboxes to specific rows depending on if a value is true or false, without adding it as a formatter? - checkbox

Does anyone know how I can add checkboxes only to specific rows in slickgrid without using the formatter approach?
Currently I've just done a columns.push(checkboxSelector.getColumnDefinition()); but that adds checkboxes to all the rows.
When I tried to use the formatter approach like this https://groups.google.com/forum/?fromgroups=#!topic/slickgrid/uKq2aVU5luo I found that when I scrolled through the grid, it would not hold the 'check' that were already selected in the checkboxes of the rows?
Grateful for any help on this.

Related

How does material-table know which rows are selected?

I am using material-table in a project. I am trying to understand how the table knows which rows are selected and any possible way to access and modify that data.
Here are some example implementations of the selection feature
I could find the answer myself on the material-table github repo.
It turns out that each rowData will have an object "tableData" attached to it, which will store parameters such as id, checked, etc,.
So if the checked parameter is set to true, that row is selected, else not.

Get Value of Selected rowwidget on ExtJS

How do I get the value of the selected row in rowwidget after the toggle. Please assist, I have tried the the bind functionality but it does not work or necessary for my problem.
if as you said row is selected then this must work: yourGrid.getSelection()[0]

How to hide the entire Ext.selection.CheckboxModel in ExtJS grid

I need to hide the entire column of the check box (Ext.selection.CheckboxModel). I found out to get the columns of the grid to hide, but the columns does not give the checkbox column.
grid.headerCt.items.getAt(0).hide()
This worked for me in 4.2.2. I used a combination of the other answer by Saki and a little traversing through the DOM because the "getAt0).hide()" solution did not work for me either:
grid.headerCt.items.items[0].hidden = true;

How to get ng-grid to hide certain rows

I have an array of objects that I want to show in ng-grid. Each row has a boolean property isVisible. In the ng-grid I want to show only the rows where isVisible is true. The other rows should be completely hidden.
I have tried using a rowTemplate and databinding a ng-show to isVisible. That hides the content of the row, but leaves the actual row in place, showing an empty row.
I have tried using filterOptions, but can't figure out the correct syntax to do such a filtering. I couldn't find any good documentation on how to set it.
I have even tried modifying the gridTemplate in the ng-grid source, by trying to add a filter on ng-repeat=\"row in renderedRows\", but I haven't gotten that to work either.
I guess I could modify the array itself, by temporarily removing rows, but I would prefer not to do it that way, since I have to be able to show the rows again (It is actually an expander that I'm doing, that should hide/show sub-rows)
Try also conditionally setting the height of the row in the template to '0' based on isVisible or use a CSS class with ng-class. Play with the CSS of it until you get the desired effect and then you can use that in your template.
This sounds like the type of thing that would benefit from using height and CSS animations actually so it opens and closes with an animated style. If you have a jsFiddle sample I'd be happy to try and help.
Edit: After looking at how the grid actually lays out it's rows (absolutely positioned) you only really have two options I can think of:
1) Filter the data you are binding to the grid through a function like dataVisible() but keep the full data list internally in the controller so you can show/hide easily
2) Submit a patch to the ng-grid project (or fork it) with the filtering capability you are looking for. Out of the box it doesn't appear to support this scenario.

Grid not updating upon change in model in angularjs

Folks,
I am using ng-grid to display a list of items.
I want to give my users ability to rearrange the rows in the list.
i.e move the rows up and down as they please.
Now,
However when I update the grid data in the backend i.e say change the index of a particular row, that row does not automatically change locations in the front-end.
What am i missing here ?
I have created a plunker to describe the problem
http://plnkr.co/edit/s1hrTSqF2zeZo3Btaln0
The grid doesn't use the index of the array to order it, so even if you are changing it, because the data is still there nothing happens.
What you could do is define an order field and update the value then changing the values as shown in this plukr. The order field you can hide it from the grid if required using columnDefs to explicitly defined which column should be shown.
Regards

Resources