You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Am a newbie to knockout and so maybe this is a thing anyone should know but is there a way to set a dynamic name for dragzone? for instance can I bind dragzone to an observable? It seems one can only have a static name there which limits ko-dragdrop for dynamic use...
The text was updated successfully, but these errors were encountered:
Well, I figured out where the issue is. I was binding to the id value of an object which was flagged as NOT being a string hence throwing the error "A drag zone must specify a name"... Currently am using this hack.... Maybe not good but works for now.. better suggestions? Is there a way to bind the 'name' option to a function for even more complex dynamic name generation?
var name = options.name;
console.log('checking-----------------1' + name); // prints out 1 (initially flagged as not being string)
name = String(name); // cast value to string
var dragDistance = typeof options.dragDistance === 'number' ? options.dragDistance : 10;
dropZones[name] = dropZones[name] || [];
eventZones[name] = eventZones[name] || [];
if (!name || typeof name !== 'string') { // crisis evaded :8ball:
throw new Error('A drag zone must specify a name');
}
Am a newbie to knockout and so maybe this is a thing anyone should know but is there a way to set a dynamic name for dragzone? for instance can I bind dragzone to an observable? It seems one can only have a static name there which limits ko-dragdrop for dynamic use...
The text was updated successfully, but these errors were encountered: