I have a grid(gridpanel) and data in it which I read from json query. After I added new bussines object(row) - I send him in json format to server, write to DB, and reload all grid. How I can focus on currently added row(b/o) after that? I will be very cool if I return added id at the json answer and grid take it and focus on row with added id.
Thx.
How is your data being added (append-mode or not?). You can do grid_panel.getView().focusRow(row) on the length of the data array in the store, which will focus on the "last" row that was inserted. Also, you could hook into the rowsinserted event of GridView, and focusRow on the lastRow parameter that's passed in there.
Related
I need to append data to a new column of a spreadsheet, every day.
But I want to make it automatically, just like spreadsheets.values.append does: but for columns.
spreadsheets.values.append will only append data to new rows, not columns!
I have tried these params:
majorDimension does work for me:
Invalid JSON payload received. Unknown name "majorDimension": Cannot bind query parameter. Field 'majorDimension' could not be found in request message.
InsertDataOption doesn't seem to make any difference
I'm sending data to a named range called "foo". When foo is already filled, the API places data at the bottom. I need the data to be place to the right.
You could push each element of the new column into each row of the 2d array with something like this: https://stackoverflow.com/a/68886835/7215091 In that case I used splice but you could probably use push instead.
I am trying to add extra array of the object to the PrimeNG expandable row but I am kind of new to PrimeNG so not sure where to proceed for this issue.
Desired Behaviour:
Basically I would like to call the extra service onclick of the row and want to fetch new array of objects and display extra details in the expandable row.
for example:
click of first row should trigger service to fetch the first car owner name and surname and display the data in expandable row.
I have tried following stackblitz
Your data structure between your car and your owner should be linked in a single object for optimzation.
You can retrieve the owner information by filtering through the vin property :
this.carownerData.filter(c => c.vin == car.vin)[0]
Anyway, because in your template, you defined let-carownerData, you should call showCar(carownerData) instead of showCar(car).
See working Stackblitz
I have received data from json web service with RESTRequest component
but I do not know how I should display the returned data in a grid?
How can I use RESTResponseDataSetAdapter to improve this?
Try this - it took me about 15 minutes to get working
Open the RESTDemos in your Delphi install's Samples\Object Pascal\Database\RESTDemo
Drop a TStringGrid on the RHS of the the Delphi-Praxis tab (I chose this one because
the URI on the Fetch to DataSet produces a 404 error).
If necessary, make the non-visual controls on the form visible.
Dbl-click BindingList and use the QuickBindings to add a LinkGridToDataSource. Set its
DataSource to ClientDataSet and its GridControl to StringGrid1. Thus will cause DBSourceDB1 to be created'.
Set the Response property of RestReponseDataSetAdaptor to `RESTResponse'.
Compile, run and click the fetch list of forums button. You should see the StringGrid populates
from the contents of memo_ResponseData
That should show you that LiveBindings can work with a RESTReponse to populate a grid. The RESTDemos demo has a lot more things in it, but if this is your first experience of LiveBindings, you might want to backtrack and try setting up a simple test project which populates a TStringGrid and a few TEdits from a dataset of your own.
I have a Talend Job that currently does the following:
Input CSV --Main--> tMap --Output--> tSoap --Main--> Output CSV
The input CSV has
ID and TYPE as input columns.
The Map creates a Soap XML (String) message using the ID from the CSV and passes that String to the tSoap component.
The tSoap component fires the web request, which sends the response to the next component. That data is then written to CSV.
The problem is that TYPE from the input CSV is not passed through to amalgamate with the SOAP response data. Only the response data seems accessible.
I've had a look at tBufferInput / tBufferOutput and tFlowToIterate but they seem to work in scenarios where the tSoap component does not depend on an input from the main flow.
Does anyone know which components can be used to achieve the amalgamation?
Thank you
If you output the data you need to reuse to a tHashOutput component you should be able to rejoin your data with the response output from tSoap assuming there's some natural join element from the response.
I solved this in the end by:
Placing between the output from the tMap and the input to the tSoap, a new component - tSetGlobalVar
Inside tSetGlobalVar, you can then create a new row, which maps an input column (Value) to a named variable that you specify as the 'Key'.
E.g. Key = "ID", Value = row11.ID
The output from tSetGlobalVar then goes into the tSoap component.
The output from tSoap goes into a new tMap.
Inside this new tMap is the Body column from the previous tSoap component which maps to an output column. To access the stored "ID" variable for the current flow/iteration, I created a new output column, and instead of mapping any columns from the inputs, used (String)globalMap.get("ID"); which would insert the value back into the flow.
I used a temporary array to populate a ListCollectionView. Later, I have a screen that displays a DataGrid using the ListCollectionView as a dataProvider. The user can delete a row in the DataGrid by selecting the row then clicking a Delete button.
How can I access the original source that ListCollectionView uses, and delete the item from there?
After I do that, will the item also be deleted from the ListCollectionView automagically, and no longer be shown in the DataGrid (or does something need to be refreshed)?
UPDATE 1
Does the following sound like I'm on the right track? (I want to remove it from the source (is that the ".list"?) of the ListCollectionView, not just from ListCollectionView.)
[Bindable] private var _myLCV:ListCollectionView=new ListCollectionView(new ArrayList());
...
var obj:Object = _myLCV.getItemAt(myGrid.grid.selectedIndex); // get item user selected
_myLCV.list.removeItemAt( _myLCV.list.getItemIndex(obj) ); // delete item from source
UPDATE 2
I'm not sure why (I'm using SDK 4.5.1A), but I seem to need to add the following line of code to the above code in UPDATE 1, for the DataGrid to reliably update and show the deleted row:
_myLCV.refresh();
My impulse is to recommend deleting the item from the ListCollectionView using removeItemAt.
If you truly want to access the source instead of dealing with the collection, then it depends what type of ListCollectionView you're using.
If you're using an ArrayCollection you can access the source using the source property.
IF you're using an XMLListCollection, you can access the source using the source property.
There isn't an inherent source property in the ListCollectionView, but the List property may suffice.
In any case, removing an item from the ListCollectionView or the ListCollectionView's source should automatically update the DataGrid. IF not, you can call the refresh() method on the collection.
Spark DataGrid, like other list base controls such as List or even DataGroup, would observe change events from its dataProvider. The change events may include item removal, update, sort and insertion. This provides the convenience of updating the control by just updating its underlying data.
That said, if your intent is to "refresh" the datagrid to stay up to date with the LIstCollectionView, by modifying the array and then refresh would rather be unnecessary.