Add custom cell after the creation of a handsontable - handsontable

I'm trying the Handsontable for the first time. My requirement is this: I want to be able to add a cell after the table has been created, in which I want to customize the content using renderer methods.
My goal is to add action buttons, such as "edit, delete, etc." for each row.
It seems possible to do so when creating the table, using the renderers, but I really need to be able to do this later on.
Is such a feature possible with Handsontable ? Any hint ?

On your action handlers, try calling HOT's updateSettings passing in the new options. options takes in a list of name-value pairs which can be any handsontable property that can be configured.

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.

Dynamic editable table/grid generation with postback in MVC

I need to generate a table in MVC that can have a variable set of horizontal columns (years). I need to render a textbox in each cell and I need to postback the values to a action method. I have seen examples where the editable cells are generated but the columns are fixed (using partials). I have also seen examples where the table can be rendered with dynamic columns but without the editable cells/textboxes. Can anyone suggest an approach?
I would recommend creating the dynamic table with a textbox in each cell with an onchange action to send the data via ajax to the controller for the update.
You will probably need to pass a multidimensional array within the model and use it to create and load your table.
The question is though how are you expecting to handle this on the server side?
If you name them all sequentially and know the # of columns ahead of time the model binder CAN bind to a list for you if they are all named in the appropriate format. Do you want to generate the list from a model or some other method?
Phil Haack covers how the naming format is, although the EditorFor will handle this automatically in some cases. If it doesnt work in yours, simply naming them in this scheme should work.
http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx

Resources