I want to add a new row to my ng-grid that is the only enable to be edited. I can add a new row pushing a new object into the datasource of the grid.
I know that I can use cellEdit in the columnDefinitions object but I need that only the last row could be editable all the columns so if I press a button this last row is saved.
Any help or suggestions would be appreciated.
Related
I had this demo here that contains tab1 and tab2. What I want to achieve when clicked on custom button "View Details", data's on selected row will display is tab2. Anyone can help me how to achieve this? Thanks in advance.
demo in dojo
Hopefully this is what you are after: https://dojo.telerik.com/iRobiSAw/2
All I have done is obtained the dataItem for the row selected and then bound this to a new ObservableObject to the second tab.
var vm = new kendo.data.ObservableObject( this.dataItem($(e.currentTarget).closest("tr")));
//Added console log just to show the object has been obtained.
console.log(vm);
kendo.bind($('#grid2'), vm);
I haven't wired up the save button so the data doesn't persist back to the original datasource but I am sure this would be doing a save back to the server where you would be refreshing the datasource that sits under the first grid.
I have a slickgrid table that I refresh with new data every couple of seconds. If set enableTextSelectionOnCells to allow the user to select text in a cell, currently the selection is removed when the table refreshes.
Is there a way to persist user cell-selection during a grid.setData(newData) call?
you can use goToCell after setting data as follows,
grid.gotoCell(row, cell, forceEdit);
grid.gotoCell(0, 0, true); // it will take you the 1st row and 1st cell and will make it editable.
Use dataView.syncGridSelection(grid, true);
dataView.syncGridSelection(grid, true); function will preserve the row selection even after adding new row to the grid. Later U can check for the active cell and make it active Try it
I'm struggling to create a grid with two columns as bound columns and other two columns as dropdown and checkbox and last column is a column with update button.
I need to change the values of dropdown and checkbox and then need to store those values in the database while clicking the update button. I don't know how to save the changed values of ddl and checkbox in the database.
Thanks in advance.
I'm using jqgrid with inline editing , when the user gets to the last cell inside a row , when he clickes on "tab" key he will be editing the next row - and if it does not exist a new row will be created.
I want to add a delete row function for the user , but still to have that row data inorder to send it later to the server as a deleted row.
I tried hiding the row , but then when the user "tabs" to the next row - it goes to the hided row - and i want it to go only to the not hided rows.
Is there a way to mark a row as deleted? and then when I generate the xml from the grid rows it will be a part of those rows? or is there a way to delete the row and save it's cells values , and be able to navigate throgh the grids line without going throgh the deleted line?
Any help will be appritiated!
Thank's In Advance.
To fix problem with editing of hidden row you can try to add class "not-editable-row" to the row which you hide.
$("#"+rowid).addClass("not-editable-row").hide();
If it will not help you will have to overwrite the default "TAB" behavior of jqGrid (see the question for implementation details)
Probably more easer way would be to use delRowData which delete a row from the grid without sending any information to the server. If you want to have your custom implementation of the "Delete" button in the navigator (see the example here). Inside of your onClickButton event handler you can save the contain of rows, which will be deleted, to some JavaScript array/object and then delete the row with respect of delRowData. So you can trace all delete operation, save deleted rows and send later all needed informations to the server.
I use two grids at one PHP page.
Is there any way to get data from the first grid (i.e. after click row) and pre-fill it into the add new row form in the second grid?
thank you for any suggestion Petr
I am not sure that I correct understand what you mean under the "pre-filling". But how I understand you question you can do following:
With respect of onSelectRow event which you define on the first grid you will receive the id of selected row as the parameter. Inside of the onSelectRow event handle you can call getRowData to get full information about the data of selected row. Then using addRowData for example you can add new row in the second grid.