Kendo UI Grid Using In-Cell and Inline - grid

I have searched endlessly for the answer of this and have a feeling this is not supported. But I want to double check before I give up.
I have a Kendo Grid where I want incell editing turned on if a column downs not have a value and want inline editing for the rows that this column does have a value.
If this is possible, how do I go about implementing this.
Here is what I've tired,
Tried grid default to inline, but never got the cell edit to work.
Tried grid to default to in-cell, where on the edit event, I check to see for this column to see if there is a value, if there is, I close the cell. I added a custom commands button, and tried enable edit mode on the row from the click event. But it seems that you can't do this.
Here is what my click event did...
editClick = function(e) {
var grid = $("#grid").data("kendoGrid");
var row = grid.dataItem($(e.currentTarget).closest("tr"));
grid.editRow(row);
};
Any help will be greatly appreciated.
Thanks in advance.

This is not supported - the Grid cannot switch between the different editing modes on the fly and work-around is kinda impossible.

Related

Focusing the Row to be added in Inline Mode

I am trying to add a new row to the ASPxGridView in the inline mode. What I want is, when I click the 'New' button I want the new row that I am going to add, to have the focus, that is, the row should be highlighted. How can I accomplish this?
I have tried ASPxGridView1.FocusedRowIndex = -1; inside the InitNewRow event, but it doesn't highlight the row.
Any suggestions?
This links might guide you :
http://www.devexpress.com/Support/Center/p/Q260744.aspx
http://www.devexpress.com/Support/Center/p/Q259550.aspx
http://www.devexpress.com/Support/Center/Question/Details/Q356961

Multiple select listbox without pressing CTRL

I thought this would be easy to do but I can't find a way.
I have a ListBox with selection mode set to multiple but I the user wants to be able to select multiple items without having to press CTRL.
Does anyone know an easy way to do this?
Googled it and find the following: http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/
Here is some pointers:
Download and reference: https://raw.github.com/ehynds/jquery-ui-multiselect-widget/1.12/src/jquery.multiselect.js
The just type:
$(function(){
$("select").multiselect();
});
Of course you need to reference jQuery as well, and the css to make it look good.
What the widget does is that it takes an select list and turn it create a list of checkboxes around it and styles them properly.
A simple jsfiddle example I put together: http://jsfiddle.net/AFVfQ/1/
It is not perfect, but it should show you how it works. Note the resources on the left hand side, the I'm referencing jquery ui css and a theme.

How to make an entire jqGrid disabled/readonly

How can I make an entire jqGrid disabled/readonly?
I have a page with a logical "edit section" which I show when the user selects something to edit, and hide when the user is done editing (save or cancel). While the edit section is shown, I disable several other elements on the page. I would like to disable their ability to click in the jqGrid, so they can't change selected rows, re-sort, etc. But I cannot find a way to disable/enable the grid as a whole.
Apologies if this has been answered already - other questions seemed to focus on disabling only certain behaviors within the jqGrid.
Edit: Preferably, I'd like an approach that isn't dependent on yet another 3rd-party addon. Nothing wrong with them, of course! But my client has a degree of reluctance with them, so my life would be a little easier with a purely jQuery/jQueryUI/jqGrid solution. :)
You could use blockUI to block the grid.
Try using $("#lui_" + myGridId).show().
The grid has created this overlay internally an uses it as one part of the loader message.
You can just show it or hide it and it will disable/enable the grid for you.

buttons in a datagrid in flex

i am using a data grid in flex and i am generating data from a mysql server. However, my problem is with adding a button within the datagrid so each row has one.
i have set the columns itemRenderer to mx.controls.Button although with the buttons shown in the grid there is no label on them (even though one has been set) and the assigned click event does not trigger when hitting the button. anyone have any ideas or guidance on what i am doing wrong.
Thanks
Mark
Not to worry I have sorted it. anyone with a similar issue i suggest reading this
http://www.axelscript.com/2008/02/29/using-the-itemrenderer-with-a-datagrid-in-flex/
an excellent source.

How can I tell a QTableWidget to end editing a cell?

I'm showing a popup menu to select some values in a QTableWidget. The lowest item is a "Modify list" entry, when I select it a new window should automatically appear and the QComboBox should vanish and the cell return to a Qt::DisplayRole state.
Now Qt has all those nice API-calls like QTableWidget.edit() and QTableWidget.editItem(), what I'm really looking for is a QTableWidget.endEditing(), preferably without specifying the index of the cell, though I could get that using this call:
table.currentIndex()
… but I don't know if I can guarantee that the current cell is the cell being edited at all times.
Is there an API to close those kind of editors?
QTableWidget inherits 19 public slots from QWidget. One of those is setDisabled(), which should disable input events for that widget and all of its children.
I would try:
table.setDisabled( true );
table.setDisabled( false );
Although you said it does not work for you, there is an alternative method:
If you don't like that (the table loses focus, I believe), you can try using EditTriggers. For example:
table.setEditTriggers( QAbstractItemView::NoEditTriggers );
table.setCurrentItem(None) is what worked for me. (Don’t forget to block signals if you use some cellChanged/itemChanged slot function.)
This is with PyQt. For C++ I think replace None with NULL.
You may be able to use QTableWidget.closePersistentEditor() to close the editor. However, QAbstractItemView.closeEditor() may be closer to what you want, especially since you seem to be comfortable with the QModelIndex-based API and are already using a custom editor widget.
In my case, none of the options worked properly. So, I figured: I need to send the key press event to the line edit itself. The following works with QTreeView but probably does work with any other view or widget that opens a line edit to edit cells.
QWidget* editingWidget = treeView->findChild<QLineEdit*>();
if(editingWidget)
{
QKeyEvent keyPressEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier);
QApplication::sendEvent(editingWidget, &keyPressEvent);
QApplication::processEvents(); // see note below
}
In my case, I wanted to start editing another field directly when having finished editing one item. That is why I put processEvents there, in most cases you can probably remove that line.
PS: yeah, it's C++, but should be easily adaptable to Python. I found this thread when I searched for the C++ solution, so maybe it helps anyone else, too.
I can't speak for list widgets. But, I got here trying to do something similar.
I was double-clicking a cell, and based on the column, bringing up a sub-form with a list, then when that was closed move to the next appropriate column based on the value selected.
My problem was I could get the value in the cell and "select" the next appropriate cell, but the original cell stayed selected in edit mode!
It finally dawned on me that my double-click was selecting the cell, ie. editing.
A single-click selects the cell but doesn't open an edit mode.
Side note: Never could get that sub-form to act truly modal, so I created a loop in the calling form: while the sub form was visible, with the only code being app.processEvents()

Resources