knockout-sortable

using a draggable as a source list links items added to a sortable together?

为君一笑 提交于 2020-02-05 05:01:32
问题 excuse the hacked together sample http://jsfiddle.net/marcmeans/SqrBf/1/ If you add an item from the available students to Table3 twice and then try and move one from Table3 to Table2, both disappear. I note as well that when I'm generating a new guid for the item added to Table3, the arg.item seems be a reference to the item in the source list and not a clone. This creates a link in knockout where if I update one I update them all. I'm assuming that I am doing something wrong here, but I'm

Knockout initializing empty form inputs not work after sorting sortable form elements

那年仲夏 提交于 2020-01-06 13:09:10
问题 Here is fiddle jsfiddle.net/jw7Je I have a view model bounded to a two templates and an editable form in a single page. The two templates are initially loaded with sample data, The form is displayed without sample data through this custom binding ko.bindingHandlers.emptyInit = { init: function(element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { element.value = ''; } } <input type="text" data-bind="value: jw_fullname, valueUpdate: 'afterkeydown', emptyInit: emptyInit"

disabling individual items in knockout-sortable

蹲街弑〆低调 提交于 2020-01-03 19:41:47
问题 In knockout-sortable, I know that you can disable a sortable list using isEnabled in the sortable binding. I also know you can disable moving items using cancelDrop in a beforeMove function. The problem is, isEnabled disables the whole list, and cancelDrop can only be called after the item is already dragged and dropped onto another sortable . Is there a way to disable sortable 's click/drag behavior on certain contained items? 回答1: You can use the jQuery UI sortable options items or cancel

Prevent items to be 'droppable' in other (parent/child) elements

荒凉一梦 提交于 2019-12-30 11:01:28
问题 I use knockout-sortable.js to let the user drag and drop items to give them a different order, but I'm experiencing problems when I have multiple 'drop zones' on my page. I have nested sets, all of which are sortable, but not interchangeable. My code: <div class="sortable" data-bind="sortable: blueprint.pages"> <tr><td>Blabla</td></tr> </div> And at some other point: <div class="sortable" data-bind="sortable: selectedPage().page_sections"> <tr><td>Another blabla</td></tr> </div> I can now

Drag and drop target separate from Sortable container

◇◆丶佛笑我妖孽 提交于 2019-12-25 06:38:02
问题 I'm trying to set up drag and drop cloning with Knockout and jQuery, but I can't figure this bit out. I have the knockout-sortable binding that Niemeyer wrote, but I can't find a way to hook it up how I'd like. I was hoping the connectClass would be able to "catch" drops and pass them into the child element Sortable, but apparently not. Here's a fiddle I forked from Niemeyer that shows pretty simply what I'm trying to do. http://jsfiddle.net/Kal_Torak/g74xN/3/ My Sortable bound elements aren

knockout - issue with accessing a nested property

橙三吉。 提交于 2019-12-25 01:56:25
问题 I'm trying to learn knockoutjs by studying existing sourcecodes and making small changes to them.. The source code that I'm trying to understand here is an example of knockout-sortable.js by RP Niemeyer. The original example code is here I have made some small changes which are here The original code has a global property called maximumstudents which checked the number of students in each table. I have added a property in table called "maxstudents" which will decide how many students can sit

How to use jquery ui with requireJS and knockout-sortable?

旧街凉风 提交于 2019-12-24 15:08:04
问题 I'm trying to use requireJS to manage dependencies in my first ever single-page javascript app. Having never used requireJS before, I'm struggling with something that I think is quit basic. My project uses knockoutJS, and an addon called knockout-sortable, which provides knockout bindings for the jquery ui 'sortable' plugin. It all works fine when I just load jquery ui, knockout and everything else without requireJS. My require main.js looks like this: require.config({ baseUrl: '/Scripts',

Copying an item rather than moving in the knockout sortable seating chart example

回眸只為那壹抹淺笑 提交于 2019-12-24 04:08:07
问题 This is the seating chart example of knockout sortable: http://jsfiddle.net/UdXr4/ Based on the answers of this and this, I tried to change the seating chart example such that the items from available students copied rather than moved as in the jsfiddle here The changes are shown below : ...... ...... <div class="seats" data-bind="sortable: { data: students, allowDrop: $root.isTableFull, dragged: handleDraggedItem }"> ...... ...... <div class="new" data-bind="sortable: availableStudents">

Controlling Flash Plugins with Knockout.js, Conflicting jQuery.tmpl and Knockout-Sortable

谁说我不能喝 提交于 2019-12-20 03:00:56
问题 I'm trying to render HTML for embedding Flash objects using Knockout.js' native templating faculties. jQuery.tmpl does the job perfectly well, however I cannot use it due to conflicts with the Knockout-sortable plugin. Here's an example of flash plugins quirking with the native templating: http://jsfiddle.net/7y3ub/35/ In Chrome, the player just never shows up. In Firefox, the player will show up if you change the channel while the checkbox is checked. Rechecking the box however makes the

if binding without container element not working for sortable

一曲冷凌霜 提交于 2019-12-13 02:06:08
问题 I modified a JSFiddle from rniemeyer to illustrate the problem: http://jsfiddle.net/mTqMt/1/ <div class="container" data-bind="sortable: groupOrItems"> <!--ko if: type=='Group'--> <div> <div class="title" data-bind="text: name()"></div> <!--here I would actually have a nested sortable--> </div> <!--/ko--> <!--ko if: type=='Item'--> <div class="item" data-bind="text: name()"></div> <!--/ko--> </div> Firebug says: "TypeError: node is null" line 546 in knockout-latest.debug.js I tried it with