I have multiple items in RecyclerView element, and the IDs of those items are generated automatically.
For some reason, I need to set specific id values instead of automatically generated ones.
My question is it possible to set specific ID values on items in the RecyclerView element.
Is it possible to set specific ID values on items in the RecyclerView element?
Related
Is there any way to get all of the children of a parent row? The only method that I see, is to grab all of the rows and look at the parentId's assigned to the children.
(For what it is worth, I am using the javascript api)
I don't believe it's currently possible to explicitly request all child rows of a specified row, using the SmartSheet API.
As you've described in your post, you'd need to use the Get Sheet operation to get the list of all rows in the sheet, then look for row objects in that result set where parentId matches the id of the parent row you're interested in.
There is some form in a web form. It contains the list of items that use can edit, remove and change.
When the server receive the list of items, it should update existing items, create ones and remove the deleted ones.
I only know the naive and quite ugly approach:
When server receives the list of items from a client, it gets the actual list of items from the database
Pass round the received list of items:
2.1. If element has the ID and database has the element with this ID, this element updates
2.2. If this element doesn't have ID or database doesn't contain element with this ID, this element creates
Delete all items, that were not in the received list (marked as deleted)
The updated list of items are returnded to the client (with new IDs), and client displays them
I feel, that there is more elegant solution, and, propably, established for this task.
I had the same challenge and i solved it like this:
1-First when you load the page, create a list made up of id and data.
2-then the user fill the data.
3-those items that user doesnt fill should be deffault value.
4- then retrive the list from database and delete it and put the updated list
Hope this helps
I currently have a text box that can predict String as typed.I used the snippet here .
There are two seprate questions
Q1)In the snippet the suggestion are passed as item but I want to relate the String to an id to update the database. If I just pass the string to snippet I need to do another query to again retrieve the id which costs resources is there a way to pass objects to the auto suggestion which will select the id of whichever name is chosen from the suggestions.
Q2)Also I dont want user to be adding new values so is there a way to force user to chose one of the values from the suggestion for the text box and not add his own values
This might be a workaround for your Q1.
In the auto-complete shell , use a SWT Table instead of combo widget.Have two columns in the table for string and string Id.Hide the second column so that the user cannot see it.You can use this column to retrieve the ids of corresponding strings.
Or simply store the string and string ids in a hash map and give the key values set of this hash map to the combo items.
Is there any simple way to get the object, used to render given row in CellTable, by index of the row?
I am using AsyncDataProvider, and don't want to remember lists of data objects, returned from the server. Also I am using MultiSelectionModel, so several items could be selected there and I need to track out which one was clicked last.
I know the index of last clicked row, so I need to get the object, corresponding to the row, somehow.
getVisibleItem? possibly combined with getPageStart if you're using paging and you only know the absolute index.
For your use-case, maybe you could use a customized selection model whose setSelected tracks the last change.
Am having the task like in UITableView, In root view i have country list if selected the country it should navigate to next view display the state list of that country, if i select state it should navigate and displays the cities, if i select city need displays a popular areas and then hospitals list in that area how do i create plist for that. Then how shall i get value from that plist.
For this you can create PList as follows:
add independent rows for each country. Each row set value type as array. And values add multiple rows & put state and for value again put data type as Array. And put respective cities into that.
It will work for you then.
there are more ways to do it but in this case you'll get all data in a single dictionary and you can maintain your table easily using it.