javascript - how to avoid drag and drop for a specific list item in sap.m.list -
i have implemented drag n drop sap.m.list below. need avoid drag drop specific items of list. how stop drag n drop feature specific items
jquery.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-core'); jquery.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-widget'); jquery.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-mouse'); jquery.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-draggable'); jquery.sap.require('sap.ui.thirdparty.jqueryui.jquery-ui-sortable'); my.clauserendering = function (ocontrol) { //inject control //debugger; test = this; test.ocontrol = ocontrol; }; my.clauserendering.prototype = { onafterrendering: function () { $("#clauselist-listul").addclass('ui-sortable'); $("#clauselist-listul").sortable({ //connectwith : ".ui-sortable" cancel: '', start: function(event, ui) { debugger; ui.item.startpos = ui.item.index(); }, // sync model after reordering in box stop: function(event, ui) { //debugger; ---- } }).disableselection(); } var clauselist=sap.ui.getcore().byid("clauselist"); clauselist.adddelegate(new my.clauserendering(clauselist));
here html view list list take tag class "ui-sortable" items in list draggable . need stop drag , drop specific items in list.
you can initialize sortable cancel option:
$(".ui-sortable").sortable( { cancel: ".non-draggable" } );
or can set later:
$( ".ui-sortable" ).sortable( "option", "cancel", ".non-draggable" );
of course instead of "non-draggable" class can use selector
Comments
Post a Comment