Vue-infinite-loading reactivity - vue-reactivity

I'm using vue-infinite-loading on Nuxt and works great.
The problem is that if one of the items is modified, it won't be refreshed on the screen until reloading (for instance, changing the identifier). Is there any way or consideration to make it reactive ?
Thanks

I discover that using splice to remove/insert an item is not reactive, assigning new values to the array item did work.

Related

Select a Schedule (or other elements) by name instead of index number in Dynamo/Revit

I have a dynamo script that exports schedules out of Revit. It uses a bit of Python also, (not relevant to this question, but I thought I would just include it all).
It all works great, but I notice if certain schedules get deleted from Revit, it could change the "Index" number of the schedules I need to export. I would like to use the schedule name instead of the dynamo index number, as this will help me maintain the connection without checking if it's exporting the correct schedule. Is this possible?
From the pure Revit API point of view I can only answer that yes, this is possible. You are calling the ViewSchedule.Export method. The ViewSchedule element can indeed be retrieved from the Revit database by name using a filtered element collection.
Here is the final solution that works well. Using the "==" node and "List.FilterByBoolMask" node I was able to filter down to just what's in the String. Now I can set the string node to be an input for the dynamo player and user just needs to input the exact name of their schedule. Thank you Michael Kilkelly from ArchSmarter for this helpful video.
How to Dynamo: Filter List by Element Name

Segmented Keys in ACUMATICA

I’ve created new Segmented Keys in ACUMATICA for use in a specific module. I would like to assign the Dimension name dynamically but I noticed it works only with hard code or name like [PXDimension(“VENDOR”)]
Also, I have some limitation to create an IF Conditional inside the customized field… it does not recognize the IF clause (see the image).
I would appreciate any suggestion how to solve this issue.
I haven't seen how your original attempt at PXDimension looked, but I'm going to take a guess and assume you tried to reference a new custom field contained in a setup table, something like:
[PXDimension(typeof(XXMySetup.usrMyCustomField))]
If that's indeed what you tried to do, one very important thing to do is to ensure that you have a view for your table in your graph, otherwise the attribute will not find the table and record in your cache. For instance:
public PXSetup<XXMySetup> XXMySetup;
Without this view declared in the graph, the dimension attribute will not work as expected. It would be nice if a clear exception was thrown in this case - I made the same mistake recently and it would have been helpful.

Update XPages text value from within a repeat?

I feel like I'm just not understanding something about the XPages lifecycle here. I have an xp:text control, with a value of viewScope.count. Initially, that's null. After the xp:text, I have a repeat that's performing a calculation and returning an array of objects for its value. At the end of the repeat's value section, I'm trying to update the xp:text with a count of the things in the array:
viewScope.count = myArray.length;
The xp:text isn't being updated with that value, though. Should this work? Do I need to do a manual refresh of the xp:text when I modify viewScope.count? TIA!
You should be able to use the index of the repeat to give you a count.
Take a step back and rethink the approach. Inside the code you use for your repeat you update something outside.
Not looking at 'does it work' I would claim 'bad idea'. Such side effects make maintenance a nightmare (and are not very MVC).
The better approach (IMHO):
Create an object data source. AFAIK that can be a JSON object if you are not comfortable with Java. That object would have all the needed properties for your repeat and your counter display. It serves as your model.
Then bind the repeat and the text field to the model and you are good.
Makes sense?

Kendo UI Delete a node attribute in Treeview

I have some nodes who contain the items value which seems to be initialized by default from Kendo with the value "[]" everytime!
I want to completely delete the "items" field from the node but I can't seem to find any method for attribute deleting.
I try to access the nodes through dataItem and I tried dataItem.set("items",undefined) but still I don't think it helped.I'm trying to delete the items field because there seems to be a problem with that initialization done by kendo and I can't append new nodes to them and I think it's because of it...
EDIT :
It seems that kendo.observableHierarchy(data) initializes every tree node with no children (and therefore without an items attribute all).And by initializing I mean that everytime I show the dataSource the nodes that have no children have the "items":[] attribute added to them automatically!
I tried appending nodes through treeview.dataItem(treeview.select()).append() but I found out that this method doesn't work on "old" nodes that have the "items":[] attribute added to them by kendo,so "old" nodes are all the nodes that have been loaded on the tree from page load and therefore were saved on the JSON file.
And I say "old" because if I append a new node it doesn't have the "items" field and the .append() mentioned above works pretty fine on it adding a node and updating the dataSource..This .append() works pretty fine also on "old" nodes that already have children and so their "items" field is not modified by kendo because it already exists.
I've just discovered something interesting about Kendo's suggested answer at: http://www.telerik.com/forums/clear-all-nodes
Using their code suggestion, will also delete the .items attribute:
$(".k-treeview").data("kendoTreeView").remove(".k-item");
Deleting an object field is delete XXX. Ive updated the [fiddle] (jsfiddle.net/OnaBai/UC3uW/1) by adding a third option calledremove` but unless I misunderstood what you were suggesting, it does not solve the problem. I'm afraid that this is a feature in KendoUI that does not manage HierarchicalDataSources as we expect.

NSArrayController that is sorted and unique (no duplicates) for use in a pop-up in a core-data app

I have core data app with an entity OBSERVATION that has as one of its attributes DEALNAME.
I want to reference through Interface Builder or by making custom modifications to an NSArrayController a list of unique sorted dealnames so that I can use them in a pop-up.
I have attempted to use #distinctUnionOfSets (and #distinctUnionOfArrays) but am unable to locate the proper key sequence.
I can sort the ArrayController by providing a sort descriptor, but do not know how to eliminate duplicates.
Are the #distinct... keys the right methodology? It would seem to provide the easiest way to optimize the use of IB.
Is there a predicate form for removing duplicates?
Or do I need to use my custom controller to extract an NSSet of the specific dealnames, put them back in an array and sort it and reference the custom array from IB?
Any help would be appreciated. I am astounded that other have not tried to create a sorted-unique pop-up in tableviews.
You need to take a look at -[NSFetchRequest returnsDistinctResults]. That is the level you need to be handling the uniquing of data.
Although I do not have a definitive answer for you, I think there are two ways you can go about it.
The way you already started. You need to bind the contents array of the PopUp button, not just against the arrayController.arrangedObjects, but continue on the path and somehow filter only objects with distinct "DealName"s. This means - the arrayController presents ALL the entities (and may sort them for you) but the PopUp button will have its contents filter via some sophisticated binding to the array controller.
Make your filtering at the ArrayController level (as suggested in another answer here). Here it depends how you set up the array controller. If It is set up to use an "Entity" (vs. "Class") which means the array controller will fetch CoreData entities directly - you can modify its "Fetch" to only bring a subset of the "OBSERVATION" entities with distinct values of "DEALNAME". I don't know how to control WHICH entities are filtered out in this case. Otherwise, you can setup the arrayController to work with "Class" objects, and then you can fetch the entities yourself (in code) and populate the arrayController programmatically, with just the entities you like.
In the second option, the Popup button should be bound normally to the arrayController's arrangedObjects.

Resources