setting IsDirty field in kendo gantt chart - kendo-ui

In a simple example like this - https://dojo.telerik.com/UViBAZAP How to mark the field dirty? I want to make changes first and then save at one go.
Edit- I want the field on the UI to show that it was edited. like it does in kendo grid.

You don't need to maintain the dirty field yourself, you just need to ensure that when you modify one of the model objects in the datasource, you use the set method, instead of assigning to it's fields directly.
var task1 = $("#gantt").data("kendoGantt").dataSource.data()[0];
console.log(task1.dirty); // returns false
task1.set("title","Task1 (modified)");
console.log(task1.dirty); // returns true
This way, kendo is aware of the change and marks the object as dirty for you. The datasource will also consider this a change which needs to be sync'd. Hope that helps.
https://dojo.telerik.com/UViBAZAP/2

Related

Xpages valuePicker add value

Is there a way to add a field into the valuePicker with the possibility of adding new values in it? The valuePicker get's the values from a view, and I wouldn't want to add another addButton to add some values withing that view, in separate way. I would like a dialogBox like the valuePicker + the option to add new documents withing it. It is possible?
That functionality isn't available in the Value Picker. It's unlikely to be added, because of the variety of dataProviders, which makes it difficult to know where to add the option to make it available to other documents, and also ensure validation of options.
Typeahead on an Edit Box control allows you to add entries not in the list.
Alternatively, you can add a separate Edit Box to your XPage to include a value not in the list. But if you want to store the new option in the same field, you'll need to write the code to add the option to the source of the list. E.g. if it's the dataProvider of your Value Picker is a dominoViewValuePicker, you'll need to create a document in that view as well; if it's a simpleValuePicker, you'll need to compute the options so they also look to this field. Otherwise, when the user edits the document again, the option will not be available in the list, so may get removed.
Why do you want the user to insert new values into a field in valuePicker? Instead, let the user add the new value direct into the field which is the valuePicker related to.

Kendo Grid - Customize Filter Row

there is a feature called "Filter Row" in Kendo Grid
http://demos.telerik.com/kendo-ui/grid/filter-row
I want to add a drop-down list instead of a text box or a number box, to the filter box. It's for filtering a column that has countries. So I want list of countries in a drop-down list. How can I do this?
It's very similar to the custom Filter Menu (http://demos.telerik.com/kendo-ui/grid/filter-menu-customization). I made the mistake of no using valuePrimitive: true. You might not want it in your situation but keep that in mind.
Here's a sample: http://dojo.telerik.com/OKaS
Also, the filter menu should take up the editor model of the column but it's not always what you want.
Edit
Starting from 2014 Q2 SP1, the template function now receives an object containing "datasource" and "element". In my example, you would have to change the dropdown initialization from "container.kendoDropDownList" to "container.element.kendoDropDownList". The datasource is empty in my example but I'm assuming this can be used to pass the choices to a control without requiring another datasource or to externalize your current. I have not experimented with this feature but I suggest you do before taking my sample blindly.
As Pluc mentioned earlier valuePrimitive: true will help you create a custom filter for your grid/columns to send id's to your controller, if you are not using setting this property true you will receive an Object in your controller instead of a number, the conversion will not be made automatically . This is still working as of 2019

DropDownList in custom Grid popup editor - filter datasource

I'm using a custom popup editor in a detail grid (several fields are using data attribute initialization).
One of the fields is a Kendo DropDownList, but I need the options in the list to be filtered based on the value of one of the fields in the currently expanded master row.
I've managed a buggy workaround by setting a global variable when a master row is expanded and then filtering the dropdownlist's datasource using a function call on the open event.
I'm sure there must be a better way to do this. Is it possible to specify a datasource filter using data attribute initialization -- I can't see anything in the docs for this.
Thanks
Missed the obvious...
I just needed to filter the datasource for the drop down list in the grid's edit event.

Hide Column, but display its filter, in Kendo Grid

I am looking to create a bunch of filters on a Kendo Grid but these filters are for hidden columns.
I want to display the filter (perhaps moving it outside the grid area with jQuery) but keep the entire column hidden.
Any suggestions?
Use the dataSource.filter method for that implementation.
$('#GridName').data().kendoGrid.dataSource.filter({field:"hiddenColumnName",operator:"gt",value:42});
If for some reason you want to extract these filter descriptors from the Grid you can use the filter method without parameters. An object will be returned which will contain how exactly the Grid is filtered.
Please notice that this approach does not even require to have the columns hidden (you can skip declaring them at all). The whole objects (with all fields) are available by default on the client.

YUI DataTable Changing DraggableColumn and Resizable

After a YUI2 datatable is constructed, is it possible to change configuration settings dynamically?
If draggableColumns was not set true when the datatable was initialized, how can I change that behavior later on?
Similarly, when columns are not identifed as resizable, is there a way to change it later?
I expected a datatable method would allow this to happen (set on/off), but I can't seem to find something like that in the API (http://developer.yahoo.com/yui/docs/module_datatable.html).
So, I tried browsing the datatable object and changing each column's 'draggable' flag. That didn't work and it also didn't seem the right way to do it.
How can I do this?
Every element's configuration object can be accessed via it's cfg attribute.
So, in order to set draggableColumns config property dynamically, you need to use :
myDatatable.cfg.setProperty("draggableColumns", "true", true)
Note that the second boolean argument should be a string. Refer this link for reference.

Resources