Can we move data objects up and down in pimcore 5, by default it is ascending? - pimcore-v5

I am trying to move some objects up to any object in the same folder but it always remains in ascending order. Can we make it as custom by which we can move any object to any place, if yes then how? I am using pimcore 5.

You can sort the objects according to the index by right-clicking on a folder or object -> Sort Children by -> Index.
This feature was released with 5.2.2. If you can't update pimcore, you need to create an index in your object.
Sort by index

Related

SwiftUI move list cells and populate order in CoreData database

I have a problem with moving cells and save the order in CoreData database. I've got the move from UI perspective working, but I can't understand how to mirror it in the core data. Moved list entities have orderPriority attribute in CoreData, its an Int I would like to change on move action.
Move method attached to the list is this:
func move(from source: IndexSet, to destination: Int)
It seems like source and destination are two different things, for example
moving first cell to third position gives source=0 and destination=3, but
moving third cell to first position gives source=2 and destination=0, with only 3 elements in the array destination makes no sense to me.
Source looks like array index, but destination is what I can't undersand and this is why I can't change core data entities to respective order.
Am I doing something wrong?
... but moving third cell to first position gives source=2 and destination=0, with only 3 elements in the array destination makes no sense to me.
Array indices start at zero, source=2 is the 3rd element and destination=0 is the 1st element. Index 2 becomes 0, index 0 becomes 1 and index 1 becomes 2.
By the way the type of source is IndexSet, you can move multiple items at non-subsequent indices to the destination index.
Per default Core Data records are unordered. If you have an index attribute in the entity you have to re-index the records, at least from the first index which has been changed.

How to sort subset of DataView?

How to sort subset of DataView? I use Sort property of DataView. Is it possible to sort all records except last added (let's name it "new record") - waiting until user complete entering data in fields of this new record and then initiating sort of the whole DataView.
I know it's been a while and you've moved on. But for future generations, if you use DataView.NewRow() and before you do Row.EndEdit() you can get the other rows by setting your DataView.RowStateFilter to DataViewRowState.OriginalRows.
You retain the new row, can work with those that match the filter. I would imagine that you then set the filter back to current before doing Row.EndEdit() but I've never done this particular move.
You can also use DataView.Table.NewRow(). This won't be added to your dataview until you perform DataView.Table.Rows.Add(Row). That is how I always do it - I think it is easier.

GWT: get backing object for row by id in table

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.

Is it possible to store hidden metadata information that is tied to a specific Table or Cell within a Word document?

I am trying to store metadata (basically a unique id) along with each cell of a table in a Word document. Currently, for the add-in I'm developing, I am querying the database, and building a table inside the Word document using the data that is retrieved.
I want to be able to save any of the user's edits to the document, and persist it back to the database. My initial thought was to store a unique id along with each cell in the table so that I would be able to tell which records to update. I would also like to store some sort of "isChanged" flag within each cell so that I could tell which cells were changed. I found that I could add the needed information into the "ID" property of the cell - however, that information was not retained if the user saved the document, closed it, and re-opened it. I then tried storing the data by adding a data to the "Fields" collection - but that did not work and threw a runtime error. Here is the code that I tried:
object t1 = Word.WdFieldType.wdFieldEmpty;
object val = "myValue: " + counter;
object preserveFormatting = true;
tbl.Cell(i, j).Range.Fields.Add(tbl.Cell(i, j).Range, ref t1, ref val, ref preserveFormatting);
This compiles fine, but throws this runtime error "This command is not available".
So, is this possible at all? Or am I headed in the wrong direction?
Thanks in advance.
Wound up using "ContentControls" to store the information I needed. I used the "Title" field to store the unique id, and the "tag" field to track whether the field had been changed or not. See this link for more info: http://blogs.technet.com/gray_knowlton/archive/2010/01/15/associating-data-with-content-controls.aspx
Since a "Word 2007 Document" is XML, you can add a namespace to the document then adore the elements with attributes from your namespace. Word should ignore your namespace when loading and saving. Moreover, you can add new elments to store any information (metadata) needed.
With that said, I have not used this technique with Word, but I have done it successfully using Excel 2003.
First thing to try, is create a bare "Word 2007 Document". In your case, add a simple two by two table. Open it with a text or XML editor and add your namespace, and adore an attribute and add an element. Open with Word make a change then save it. Open with editor and make sure your namespace attribute and element have not been changed.

NSMutableSet vs NSMutableArray

What's the difference?
In my context, I need to be able to dynamically add to and remove objects. The user clicks on rows of a table that check on and off and thus add or remove the referenced object from the list.
A wild guess is that array has indexed items while set has no indexes?
An NSSet/NSMutableSet doesn't keep items in any particular order. An NSArray/NSMutableArray does store the items in a particular order. If you're building a table view, you should definitely use an array as your data source of choice.
Also, NSMutableSet makes sure that all objects are unique.
NSMutableArray goes well with UITableView since elements have index, so you can return [array count] to get number of table rows, or [array objectAtIndex:rowNumber] to easily associate element with row.
Also, according to the documentation, testing for object membership is faster with NSSets.
You can use sets as an alternative to arrays when the order of
elements isn’t important and performance in testing whether an object
is contained in the set is a consideration—while arrays are ordered,
testing for membership is slower than with sets.
Well there are 3 main differences. 1) Sets are unordered 2)Don't have an index & 3)Cannot have duplicate values where Arrays are ordered, indexed & can store duplicate values.