Ok I have a grid setup binding to local data
Here it is based on the examples in the kendo demos
http://dojo.telerik.com/#marcushaslam/ovOKo
I'm having problems when rows are deleted. They appear to be deleted but then the original rows re-appear when columns are grouped.
Grouping works when 1 row is left - delete both rows (they disappear) group by a column and the original 2 come back!
I thought that the datasource automatically updated based on the destroy events. Am I missing something that will update the original data array from the datasource?
You are missing transport configuration, that will update correctly the array and the grid. Please check this article that explains how to implement transport functionality with local data:
http://docs.telerik.com/kendo-ui/web/grid/how-to/grid-localstorage-crud
Related
As you can see in the picture this is a kendo grid that gets the data from the database and do the sorting, paging and grouping and right now it has been grouped by. My record are a lot, they're more than 2-3 millions and because of this reason I can not send all my data to the grid so first the I send a request to database and then I receive the paged, sorted and group by response back from the server and everything works great but sometimes there might be only 2 set of grouped data but inside these two there might be millions of data so this is what I did, I just show the name of the groups with no child data. My problem is that when someone clicks on a group, I want to open up it's nodes and show the related data. but I didn't find any method in kendo to show the nodes' data that is present inside a datasource in its related node.
I am doing an inline add using Kendo Grid, but on the server side I am actually creating multiple records. The DataSourceRequest sends back all the newly created rows, but only one is added to the grid. The other added records may not show up in the grid at all until the grid is forced to query for the data again.
Is there a way for me to add multiple rows at once?
If not, is there a way to re-query the data and put all newly added models at the top?
In my controller function that creates the new records, I am returning the following. "models" contains all of the newly created records:
return this.Json(models.ToDataSourceResult(request, this.ModelState), JsonRequestBehavior.AllowGet);
I also have a similar issue when updating a row since the server may actually update multiple rows. Since "models" contains multiple models, the first one in the list may or may not be the actual model selected to be updated, so sometimes a different edited model will replace the model that was selected to be updated in the grid.
Thanks,
Rob
I ended up using the kendo grid datasource insert method to add any records returned by my controller that were not already in the grid. I did this in the RequestEnd event for the datasource.
In order for this to work for inline adds, I needed to make sure the first model in the list returned by the controller was always the model being added by the grid. For some reason the initial model being added does not have an ID until the dataBinding event is reached which occurs after the RequestEnd event. So on adds, I simply ignore the first model in the results because it is already in the grid.
Also, when editing rows that are manually inserted into the datasource and then cancelling the edit, the grid removes them from the datasource. I had to block this using the preventDefault() function in the DataBinding event when a "remove" action was encountered directly after editing a row that I manually inserted into the datasource.
I am trying to create a standardized dashboard using dc.js. One question that i require help with is if its possible to filter the visuals based on a selection of the data table rows.
I am thinking of populating a table with unique column values and then using it to view filtered data.
I found a similar question here how to filter data in dcjs/crossfilter on selection of datatable row?
Not sure if there is another way of doing it internally in dc.js and hence the question.
Here is a sample dashboard made using spotfire. Here i can filter the data by selecting unique values from the filters on the right.
Thank you.
You can try the multiple select menu widget which was contributed in this PR:
https://github.com/dc-js/dc.js/pull/771
This will be included in the 2.1 release of dc.js
I have a column in a Google spreadsheet with data validation, that makes a drop down menu available when editing existing rows. Occasionally though contributors create new rows at the bottom of the doc and this validation is lost.
I would like to keep this validatation in the column even in newly created rows (excluding the header row).
I have seen much of this discussion throughout stackoverflow and google help forums, but still cannot find a clear answer.
My hunch is that this would involve Google Apps Acript using an onEdit trigger and then either paint formatting or a combination of the confusing class DataValidationBuilder. (https://developers.google.com/apps-script/reference/spreadsheet/data-validation-builder) but I'm not sure beyond that.
While not necessarily elegant I found the following to work:
create your validation on the entire column
once that's done click the cell(s) that represent the heading, select data / validation, and then click on 'remove validation' on that single cell.
This way any newly inserted rows will inherit the validation set up on the entire column and you don't have to always be reminded that your heading isn't a valid value.
onEdit trigger which uses Range.getDataValidation() and Range.setDataValidation() to copy the rule from an existing row to the new row
While in the data validation dialog screen you can manually enter the range as "Sheet1!A:A" to apply the formula to all of column A.
This also includes new rows added afterwards
I'm not sure if this is a new feature but this worked. Set the validation as list from interval and interval as:
'sheet'!C2:C
This includes all new rows excluding title(first row)
I am using a RadGrid to display stock information. The data bound is a combination of 2 views and 2 tables. This is quite an intensive query, and the data behind it changes a lot. Now, when I update a value in a single row, I have to Rebind the data to update my grid (I use UpdateValues on the item, but it has no visible effect). This is taking too long to be user-friendly. Is there a simple way to work around it, so I can just update the row which has the changed data ?
I do not think there is a way to do that because the Telerik Grid is data bound control - hence to modify its source and refresh the data in the grid UI, you will need to bind all rows.
Dick