Search code examples
javascriptwinjs

WinJS.UI.ListLayout make contenteditable on one item but have itemsReorderable


How to make content of one column in item in WinJS.UI.ListLayout editable contenteditable="true", but remaining list columns remain active to other operations of ListLayout such as itemsReorderable="true"?

e.g. column:

<div class="person" data-win-bind="innerText: person" contenteditable="true"></div>

list view config:

data-win-options="{ layout:{type: WinJS.UI.ListLayout }, itemsReorderable: true, ...


Solution

  • I finally found answer: class win-interactive has to be used inside that element or in any of it's parents.

    <div class="person win-interactive" data-win-bind="innerText: person" contenteditable="true"></div>

    This disable ListView behavior for an item and make possible adding interactive elements to an item template.

    Based on this http://msdn.microsoft.com/en-us/library/windows/apps/Hh700705.aspx