YUI DataTable Changing DraggableColumn and Resizable - datatable

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.

Related

setting IsDirty field in kendo gantt chart

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

How to set minLength for PrimeFaces autocomplete

I have dialogbox which consists an autocomplete element and several other fields depending on it. What I want is to run completeMethod when autocomplete field is empty. However, this method executes only there is one or more character in the field. For instance, assume I typed 'x', then if I remove it, it should be called. I need to know if it is empty because I will change other fields according to it. I already tried minLength but it has no effect whatsoever
<p:autoComplete id="findCommand" value="ControllerClass.someObject
completeMethod="#{ControllerClass.completeCommand-returns objects-}/..>
<p:ajaxlistener="#{ControllerClass.onCommandChange} update="someotherfield"
event="itemSelect" /></p:autoComplete>
The completeCommand method won't be called if the field is empty. Here is what I tried:
1- I added an ajax tag with change and assigned some other method to it to control the field. But it
ruins itemSelect ajax, since it tries to assign query string to object when user types something, which is wrong.
2- I tried to use second answer, however since I can't figure out if field is empty, it has no use:
JSF access html element value in bean class
minQueryLength = "0" worked. Here is the link I've found this.
http://www.primefaces.org/docs/vdl/6.0/core/
You can select autocomplete from the left menu

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.

jqGrid - ambiguous npage parameter from prmNames property

I'm using jqGrid to load data with virtual scrolling. It is working ok, but I'm also trying to make it load some data ahead, at least one page ahead, to avoid the loading appearing while the user is scrolling. In documentation, the npage parameter is the one specified to handle this. I assigned boolean values to it, int values from 1 to 100, but doesn't have any effect. What am I missing?
If you set the npage option in prmNames, then the grid will sometimes
request more than one page at a time; if not, it will just perform
multiple GET requests.
jqGrid Docs
demo virtual scrolling-npage is set to null
You have misunderstood the documentation a little bit. You need to set the npage property of prmNames object to a string, for example like this:
prmNames: {
npage: 'npage'
}
This will tell jqGrid that when dynamic scrolling is enabled (the value of scroll option is different than False) it can (at own will so not always) request more than one page by adding the number of pages it want to the request under the key by name which you have specified in npage property.

How do you switch backing bean objects in JSF?

Suppose I several tags, text input, radios, etc referencing one instance object. I would like to use a dropdown on that page to switch the references mentioned before to another instance of the object.
This part is pretty easy with change listener. However, the problem I have is the values currently displayed on the screen are getting set into the new, second instance.
I would like the current values to be stored in the current instance, and then the when the page refreshes I would like the new values to come from the new instance and be displayed on the screen.
Is there was way to do this? Does my question make any sense?
Grae
A value change listener is exactly the wrong tool for this, because it gets called before the values are set.
What you want is an action listener, which will get call after the values from the page are validated and set.

Resources