how to update the edited data in the dhtmlxgrid to the database - asp.net

I loaded the dhtmlxgrid from the database.I am able to edit the data in the grid also.i want that edited data has to store in my database.
Any suggestions..

You can call a function everytime a cellValue is changed and write and update query.
grid.attachEvent("onCellChanged", updateDatabase(rId,cInd,nValue){});
nValue will contain the new value of the cell.
rId and cInd are the row- and column indexes of the changed cell.
http://docs.dhtmlx.com/doku.php?id=dhtmlxgrid:event_oncellchanged

Related

Return one record from a form data source

I have a form with an existing data source. This data source has a one to many relationship to another table that is not an existing data source. Even though this second table contains multiple records (one to many), the field in the table that I want is duplicated across all records. Therefore I want to add this second table as a data source, but only return one record from it.
If I add the second table directly, than my form contains a line for each record instead of just one.
This problem was solved by creating a view to use as the new datasource. This view defined a calculated column that was based on a method that contained a query string that used TOP 1. The details in much more detail are at Martin Dráb's blog: https://community.dynamics.com/ax/b/goshoom/archive/2015/06/29/join-first-line-in-ax-2012.
Use the property LinkType=ExistJoin on the datasource for your second table.
See the TransactionLog form for example.

oracle adf how to invisible current row?

I have oradcle adf and jdeveloper.
I want to invisible current row in a table by click on a button(named "delete_row") .
Can anyone help me ?
I think you are looking for a soft delete of rows from table. Refer to this post Soft deletion of rows
You can make the row invisible but once you open again the application it will show again as this information is not stored anywhere. Better you have to override the remove operation for the current row. Once the remove operation is called you should change the value of a column from the table (boolean deleted for example). The query used in VO iterator for that table should not get rows with that value as false. Please check: http://husaindalal.blogspot.com/2009/11/generic-way-to-handle-soft-delete.html

How to makes datasource truly unchangable?

I have datasource on a form created by code.
formBuildDataSource = form.addDataSource("My_table");
than I open a detail which has datasource from same table and dynamic link and same data row. When I change something od detail and than run
getFirstSelection(formCaller.dataSource(1));
I do not get old data but the new modified data. Is there a way how to get old data from base form before this modification? Somehowmake data datasource on old form unchangable (for whole existence of form).
When I set
formBuildDataSource.autoQuery(false);
formBuildDataSource.autoSearch(false);
than I see no data on a first form. So it would be nice to do something like:
formBuildDataSource.getData();
formBuildDataSource.autoQuery(false);
formBuildDataSource.autoSearch(false);
The Args.record(...) is used for something else so it would be nice to do not need to use it.
I am using AX 2012.
It isn't very clear what you are trying to achieve. If, after modifying a record, you want to check what values its fields had before the change ("Is there a way how to get old data from base form before this modification"), you could have made a copy of the original record before making the changes, e.g.
MyTable myTableOrig = myTable.data();
or if you don't need system fields then
MyTable myTableOrig;
buf2Buf(myTable, myTableOrig);
After that you can always compare current myTable field values and original field values copied to myTableOrig.

Deleting GridView’s rows

Let’s assume that ( the first time page is created ) I manually bind GridView to some data source. Is there’s a way to configure GridView to delete a row ( by pressing row’s delete button) without handling any of the delete events ( in other words, we wouldn’t try to delete a row in data source and then rebind GridView to it)? Instead, GridView would simply remove that row from its ViewState and then display all rows minus the deleted one
thanx
So then how would you end up remembering this and deleting it in the db?
Why not do what may be simplier is to have a bit field in your table called
Deleted. That way when someone deletes something accidentally it is still there.
Your record set would make use of a WHERE clause to filter Deleted=False
Instead of binding the GridView to your data source, bind it to a collection built from your data source. You can then add to, delete from and modify the collection as much as you want, without ever affecting the underlying database table.

How to Display a DataGrid with Insert Mode without any pre-filled data?

How to display the datagrid in insert mode without any data in it.
The GridView is empty and contains only one header.
I want to insert the data in the GridView when the application is running.
What you could do is using an empty Binding Source to a List which would enable you to add new Rows.
Check out some samples of how to use the Binding Source here
Please have a look at these 2 examples:
Insert rows with a GridView
Adding Insert Capabilities to the GridView
I don't think the datagrid will be rendered if its data source is empty. To work around this problem you can give it a data source with only one item that is regarded as empty (for example a data table with one row where all columns have empty values). You can then check for this special case in your program logic.

Resources