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.
Related
I only have two fields in my grid. Just need the entire row to not appear, if the value in one of the fields is 0.
There are multiple solutions for your need, but this one is working for me in a similar setup.
Following code is in the PostBuild event of the component:
Local Rowset &rs;
&rs = GetLevel0()(1).GetRowset(Scroll.MainRecordOfTheGrid);
&rs.Flush();
&rs.Select(Record.MainRecordOfTheGrid, "WHERE FieldA<>0 and FieldB<>0");
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/
I have a DevExpress ASPx GridView control and am trying to implement sorting for the grid columns.
The gridView contains has integer values in one column, text in the rest. I also have a column which contains hyperlinks and is added through the code behind during run time.
I am using the Aspxgrid_CustomColumnSort event for sorting the grid.
I can achieve the sorting for the column which contains the integer values and texts successfully, however the same code is not working for the column with hyperlinks.
When I click on the column header the hyperlinks sorts in ascending order,
but when I click the header the second time the grid isnt getting sorted in the descending order, the hyperlinks are sorted in randomn order ( neither ascending nor descending)
And, further clicks on the header do not do anything.
Any advice/suggestion will be greatly appreciated.
Maybe this link will help: http://www.devexpress.com/Support/Center/p/B145444.aspx. In this page, someone had reported an issue using the GridViewDataHyperLinkColumn.
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".
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.)