Insert row in nested Telerik MVC grid - telerik-grid

Insert new row button doesn't insert new row in nested grid(Ajax Binding) when I hide (Hidden = true) key field.
Is it a bug or I missed something?
Do I need to bind key field for getting it's value in controller method? I see in telerik examples that its' not obligatory...

it works if you move it to after all columns, even after command columns

Related

Tabulator adding new row is not applied custom sort defined

I am using tabulator 4.8.4. I have tabulator defined with customer sort using sorter function in column. Sorting is applied properly during first load. When i add new row custom sorting is not applied.
table.addData([{
orderNO: order.orderId,
},false]);
It will be either inserted in the top or bottom based on the boolean value passed. I have to call below method to apply sort for newly added row
table.setSort(table.getSorters());
Now the problem is when ever new row added table focus is moving to the top. Its very difficult to navigate rows mean while additional row is coming in. Every time row added foucs is moving to the top. I tried to get the current scroll position before adding new row
scrollVertical:function(top){
position = top;
console.log('position'+top);
}
But i did not find the way to set focus to this position after table redrwan. Please suggest and let me know am i doing anything wrong here
The addRow or addData functions are specifically designed not to re-sort the table when a new row is added as this would be a very jarring experience for the user.
If you need to do this then i suggest that you use the addRow function and then call the scrollTo function on the new row to scroll it into view after the sort is finished
table.addRow({orderNO: order.orderId})
.then((row) => {
table.setSort(table.getSorters());
row.scollTo();
});

Swift 4 Mac OS TableView Col failing to get binding value from Core Data NSManagedObject

Condition: I have an NSArrayController in an NSViewController properly bound to a Core Data entity. I have added buttons to add and delete rows (see pic) that are properly connected to the array controller. But, when I add a row, instead of getting the bound variable as the table cell contents, I get the title of the cell.
Information: In the image provided below you see a view controller with a table view and a text field. The text field value is bound to the Array Controller.selection.myvariable, and it properly shows the value of myvariable. The table view column is bound to Array Controller.arrangedObjects.myvalue, but it shows the cell.title ("New Table Cell") rather than myvalue.
Question: What have I missed to get the proper value into the cell. I have not implemented Table View Delegate or Data Source methods. My understanding is that the Cocoa Binding eliminates the needs for such "glue". Why does the textfield work but not the table column? Thanks for helping if you are able.
In Xcode 9.1 you can't bind the tableview column to the attribute, you just bind it to Controller Ket to arrangedObjects and leave the Model Key Path blank. Then bind the text field cell of the column to the Model Key path objectValue.yourvar.

Editable Datatable RowKey Null

I have an editable Primefaces Datatable configured to call an onCellEdit() method when a cell is edited. Everything works great except that CellEditEvent.rowKey is always null in spite of setting it explicitly to a valid value in the Datatable declaration with 'rowKey='. The Primefaces Datatable documentation leads me to believe that I need the rowKey to get the contents of the row containing the cell being edited. I need the entire row's contents so I can compare the displayed data with the same data in the database to determine if the persisted data had been changed by another client since the Datatable was rendered, catching concurrent edits.
After reading a dozen or more posts on the rowKey being null with row-selectable Datatables I finally realized that rowKey is populated on row select, not on cell edit. rowIndex, however, is not null on cell edit, and reliably gives me the row number (zero-based) so I can retrieve the entire row's contents, and the values of the object used to populate the row (which in my case includes the value I wanted to put into rowKey) from Datatable.getValue(). The purpose of rowKey is not clear in the documentation (to me), so I thought I would share this for anyone encountering a similar problem.
The root cause has been explained by #snakedog already. I will add the code for remedying the issue.
Here is the attribute that you should put within p:datatable:
selectionMode="single"
If you do not want the selection highlight to be seen visually, add disabledSelection="true" as well.

Kendo UI For Angular2 - Grid Row Select

I have a working <kendo-grid> component with 10 visible rows over a data set of 34 rows (approx 4 pages). Sorting and selecting is working as expected.
<kendo-grid [data]="gridView"
[pageSize]="pageSize"
[skip]="skip"
[pageable]="true"
[height]="300"
(pageChange)="pageChange($event)"
[sortable]="{ mode: 'single' }"
[sort]="sort"
[selectable]="true"
(sortChange)="sortChange($event)"
(selectionChange)="selectionChange($event)">
Say I select second row. Then I sort the table and the selection stays on row two but of course it's highlighting a different record. It's always selecting the second row on the grid, which of course, it's what I want.
How do I clear the selected row in my (sortChange) event so at least the user isn't presented with a different selection that they one they already chose. I am open to some kind of data binding attribute for selected row that I could set to null or some property on gridView or even poking around inside #ViewChild .
Any help would be appreciated.
Normal Sort
Ascending Sort
Descending Sort
I had a similar question here: Select grid row item from code
Basically, you also need to select the grid row item from code without user interaction and this is currently not supported in the current beta build of the Kendo UI Angular2 controls.
In my application, I resort to triggering a click event on the row I want to select. :/
I do this in a case where I have 'up' and 'down' buttons to rearrange the grid and want to maintain my selection when I switch items.
var grid = document.getElementById('myGrid');
var rows = grid.getElementsByTagName('tr');
rows[idx].click(); // add one to the desired row index to skip the header row
Here's a (sloppy, minimal) Plunkr of this scenario: http://plnkr.co/edit/09dlqdl0Xchoy0e5zKRq

How to prevent a viewPanel with category filter showing empty rows if filter is not set

I'm having this categorized view displayed in a view panel where the category column itself is not shown. Instead I'm displaying a combobox above the viewPanel where users can select from all the categories available (see screenshot below). The combo is bound to a scopeVariable and is refreshing the viewPanel onChange. The viewPanel has a computed categoryFilter reading from the same scopeVar. That all works nicely.
Now I also have implemented an additional wildcard (*) value in the selection list which (if selected) programmatically sets the cat filter to NULL. This way I'm forcing the viewPanel to show all entries. Again, this works fine, but with the drawback that now the view is showing empty rows where the category entries would be shown normally (in the screenshot you see empty rows above each entry, with 2 entries for the category "edcom GmbH" obviously belonging to the same category; those aren't separated by an empty row):
One way to at least hide those empty rows would be through means of css coding. But I would prefer those rows not being rendered at all.
Can this be done at all using a viewPanel, and how? Or do I have to use other controls like a repeat or a dataTable maybe?
Thanks in advance,
Lothar
One "hack" (an ugly one I admit) would be to change your categorization column from Firma to Firma:"--All--" or Firma:"*" and then instead of setting the category filter to NULL you set it to "--All--" (or "*").
The double category hits the indexer, but should do what you need.
Obviously there's no easy way. So meanwhile I'll stick to this css-style solution:
In the view panel und All Properties - data I set var = "entry". Then, under All Properties - styling I set a programatic value for the rowClasses property:
if(entry.isCategory()){
return "rowStyleHidden";
}
return "";
The style class "rowStyleHidden" hides those rows using
display: none;
Don't know yet how this turns out performance-wise, I'll have to observe this once I implement it in a copy of the real database.
You can also switch to a none categorized view, by having the viewname calculated based on the value in combobox.

Resources