Dojo Datagrid open first cell of new item for editing - datagrid

I am trying to use doStartEdit(inCell, inRowIndex) function of datagrid to open first cell of newly added row for editing in dojo 1.9 Enhanced grid, but the function does not work.
It says in api that the arguments should be:
inCell - object of a cell (I get it with getCell() function)
inRowIndex - index number of a row
I am not sure because arguments are not clearly described in the api, I tried to look at the same variable descriptions near other grid functions.
I tried other variations of arguments, like cell number insted of object, and row object instead of row index. None of them worked. Is it a bug? Or I just use it in wrong way?

If you are looking to do is focus and set a cell for editing by the user then below should work for you.. that will focus on column 1 row 1.
grid.edit.setEditCell(grid.getCell(0),0)
Fiddle:http://jsfiddle.net/Pjzef/

Related

GWT DataGrid with editable sub rows

I have created a DataGrid with GWT 2.5, based on the DataGrid from the GWT showcase. The main difference from there is, that I need editable cells in the sub rows.
When changing the TableBuilder for the sub rows from TextCell to EditTextCell in the code above, editing as such is working.
But this has problems I do not see where they are coming from and how to fix:
- When clicking on a cell in a sub row, editing starts corectly, but the value of the cell in the root row is shown
- after editing, the new value is shown i the cell in the root row. The value in the edited cell is the same as before the editing.
Here you can see the problem in the sample code from above, just making the cells in the sub rows editable.
When looking at the FieldUpdater of this column, I see that always only the root row is provided as parameter, even when editing a sub row. The subrow information is found correctly in the context internally, but it is not provided to my handlers.
Overwriting the Column and providing back the sub row to the FieldUpdater shows a different problem: all the cells from the edited cell until the root show the new value. When hiding and showing the friends, the values are correct - As seen here
I clearly miss something here, about how the DataGrid rendering works. Someone can help me here?
Any help welcome,
Michael
The solution to this is to create your own Column, and overwrite onBrowserEvent() or store the respective data object in it.

Flex 4 How do I access a specific cell by index?

I would like to edit a cell by the row and column indexes so essentially do the following:
advDataGrid[2][3] = "Dogs"
so that I am setting the data grid row 2 and column 3 to Dogs. I cannot for the life of me figure out how to do this!
Side note: I need this because I am trying to allow the user to copy a section of an excel file to a section of an AdvancedDataGrid like Google Docs does. I am using this idea to do it: http://mannu.livejournal.com/348299.html
Thanks! Any help will be greatly appreciated!
In general you want to operate on the dataProvider rather than the presentation (AdvancedDataGrid). So in your case, I would get the item associated with the specified row from your dataProvider and modify whichever element is specified to "Dogs". So something like this: adg.dataProvider[row].someColumnData = "Dogs"
EDIT: "someColumnData" refers to whatever property you have set for the column to display. So when you defined your AdvancedDataGrid's columns, you set the 4th column to use the "someColumnData" property of the items in your dataProvider, and you want to change the value in the 4th column, then you'd set it as described above. Hope that clarifies things.
Flex components are data driven, so you should modify the data provider of the grid.
What if you want to edit specific individual cells, eg I want to to keep running totals of some cells in other cells, IE: as a user edits I update whole columns.
Surely their must be a way to walk the array and get Column4.row6 = something.

Dojo DataGrid - Getting data store item from formatter?

From what I've seen, the formatter function in Dojo DataGrid is given the following arguments: cell value, cell row number, and the cell object itself. Can you suggest how to obtain data store item to which this cell refers, given these arguments? Or if you can suggest an alternative way, I'd be grateful.
Found it. The grid has a method called getItem(), which accepts row number as argument.

Edit first column of GridView

I've got very dynamic GridView and I need to allow to user to edit first column of it. After he edit first column of grid it must be updated on DataBase.
Is there any ways to handle it ?
My only idea is to put some changeable element to first cell of each Row so it must be able to set / get my values for each row but can't find yet any examples of it ...
Additional info :
GridView takes data from Object data source and all columns are dynamic (yes, maybe except first, but I add it in dynamic way) and load complete DataTable... \
Currently Using jQuery+Ajax methode on dynamic button but can't disable button's PostBack so with a PostBack it just disappears and dont make the event it must to make...
Since you have dymanic columns, for each column, specify the read-only property (If a column is read-only, it may only be looked at, and not edited when in the GridView's Edit-Mode).
So, the first column of would be readonly="false" (or omit it entirely) and the other columns read-only="true".

DataGrid edits label instead of data

I have an editable DataGrid in Flex, with data full of numbers. The columns have no special itemRenderer, but a labelFunction, which returns the number as-is if positive, but puts it in parentheses if it is negative, like so
27.3 => "27.3"
-27.3 => "(27.3)"
Now, these cells are editable. When I try to edit a cell with a positive number, nothing is wrong. But if I try to edit a negative number, it starts editing (27.3) instead of editing -27.3. Because of this, when the edit is done, the labelFunction is evaluated with the new value in parentheses(i.e., labelFunction is called with "(30.5)"), and converting it to a Number results in NaN.
So, I want to know if I can make the DataGrid edit the data in the dataProvider instead of the label that it shows.
I hope I am clear with the condition. Please ask if you need any clarification.
Thank you.
Is this what you're after?
Example: Modifying data passed to or received from an item editor - From livedocs.adobe.com
(You may still have to scroll down once the page loads... The anchor doesn't seem to be working for me.)

Resources