WinJS Listview prevent drag and drop on specific element only - drag-and-drop

I have a ListView in my WinJS app that uses the built in drag and drop functionality to allow users to reorder pages in a document.
Is there a way to prevent some elements within that ListView, in this case the first item, from being dragged?
I am using WinJS 4.1

I think that I found the answer,
var firstItem = listView.getElementsByClassName('win-itembox')[0];
firstItem.draggable = false;

Related

Refresh a widget programmatically

I'm developing an app in Flutter, and I'm stuck with this: I have a list of widgets that I generate dynamically. When I press a button, I need to show or hide one of the widgets in the list. I use the Visible widget to show or hide them.
The problem is that I need to know how to update any of the specific widgets in my widget list as they are dynamic and are separated, it is getting complicated doing int programmatically.
How can I do it?
PS: I have the same app developed in Android Studio and I do it by traversing for example the child Views of a LinearLayout and then I ask for its id programmatically.

.net maui ListView don't scroll to added item when binded to ObservableCollection

I have a maui ListView binded to ObservableCollection, I expect when I add a new element to the collection my ListView automatically scrolls to that new Item.
But instead my ListView doesn't update itself,
I added a CollectionChanged event on my code behind (trying to achieve this), and make a manually scroll when item added but no when I run
LstItems.ScrollTo(e.NewItems[e.NewItems.Count - 1], ScrollToPosition.End, false);
My ListView goes to the end but it rebuilds all the entire ListView as you can see at Adding New Item to ListView
I tryed changing CachingStrategy to: RecycleElement, RetainElement but same result.
I tryed using ScrollToPosition to MakeVisible But same result.
I tryed setting to false the Animation parameter of ScrollTo But same result.
My questions:
There is a way to make my ListView automatically scrolls to the
new added item? If not:
There is a way to manually move to the new
added item wihtout the UI effect of rebuild the entire ListView?
You can try to use CollectionView to achieve this.
You can scroll to the last item by using the following code:
mCollectionView.ScrollTo(myViewModel.Items.Count - 1, animate: true);
For more about this, you can check: Scroll to End.

How to create drag and reorder grid view item in flutter without using any package?

How to create drag and reorder grid view item in flutter without using any package?
I want create grid view with user can reorder its item. but there is no custom way available
and there are only few packages are there
Not sure I know what you mean, but you can use the Draggable() Widget to make something dragable. Just put a container in there and you can drag it.
Then, you can use the DragTarget() Widget with a container child to allow a Draggable() to be dragged on top of it.
You can use the onAccept method to define what happens when a Draggable() Widget gets dragged on top of there.

Detect if there are items left to scroll in a flutter Listview

I have listview in a gridview in a flutter calendar app. I am trying to detect if a particular list view has half-visible or invisible items which need to be scrolled to be seen. If not, the user might not see that a day has an appointment/task unless they change resolution/view.
I'd like to add a little arrow, or overlay, just to warn the user there are extra items. Making the listview scrollable doesn't work well for me because then the gridview loses scrollability, unless I make the ListViews shrinkwrap, which causes its own problems.
Any help appreciated...
you can use an Text to tell the user there is more contact and if the list is on end you remove that text
by using this inview_notifier_list package
and check if onListEndReached

Is it possible to drag ReorderableListView items to another ReorderableListView?

I'm trying to drag an item from one ReorderableListView into another ReorderableListView.
It seems it is only possible by using a regular ListView with Dragable and DragTarget widgets and without the look and feel of a ReorderableListView.
Am I right or is there a way?
This is a bit delayed but I'm leaving this answer for anyone else that landed here after searching:
Consider using this flutter package:
https://pub.dev/packages/drag_and_drop_lists
Features
Reorder elements between multiple lists
Reorder lists
Drag and drop new elements from outside of the lists
Vertical or horizontal layout
Use with drag handles, long presses, or short presses
Expandable lists
Can be used in slivers
Prevent individual lists/elements from being able to be dragged
Easy to extend with custom layouts