Comments (5)
Hi,
Can you post your code?
In dragula, you have access to drag/drop events. Maybe you could use them to copy the component instances?
from ember-dragula.
The code is really basic as
{{#ember-dragula-container id="playground"}}
{{/ember-dragula-container}}
{{#ember-dragula-container}}
{{draggable-table title="SomeTitle"}}
{{/ember-dragula-container}}
And the DraggableTable component as own template and actions.
So when I drag/drop the DraggableTable to the playground, it whill copy the dom of the component, not the component itself.
So, call action from the DraggableTable component iside the playground will call infact action inside the original one.
Drap/drop events give only dom elements. And I do not know the way to retrieve a component instance from a dom element.
So, I am considering to play with lists, and use component only for visual stuff.
And using events to serialize/unserialize datas to dom.
from ember-dragula.
Would it help if I passed the ember object instance as argument for the
events?
Regards,
Pavithra.K
On Thu, Apr 21, 2016 at 8:10 PM, Quentin Gerodel [email protected]
wrote:
The code is really basic as
{{#ember-dragula-container id="playground"}}
{{/ember-dragula-container}}{{#ember-dragula-container}}
{{draggable-table title="SomeTitle"}}
{{/ember-dragula-container}}And the DraggableTable component as own template and actions.
So when I drag/drop the DraggableTable to the playground, it whill copy
the dom of the component, not the component itself.So, call action from the DraggableTable component iside the playground
will call infact action inside the original one.
Drap/drop events give only dom elements. And I do not know the way to
retrieve a component instance from a dom element.
So, I am considering to play with lists, and use component only for visual
stuff.
And using events to serialize/unserialize datas to dom.—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#19 (comment)
from ember-dragula.
It depend of the Ember object we talk about.
In this case, I request the el
parameter of events.
from ember-dragula.
//app/utils.js
export const getComponentFromId = (id) => {
return FrontEmber.__container__.lookup('-view-registry:main')[id];
};
export const getComponentFromEl = (el) => {
return getComponentFromId(el.id);
};
//app/editor/controller.js
//[...]
didDrop(el, target) {
let table = getComponentFromEl(el),
playground = getComponentFromEl(target);
playground.tables.addObject(table.model);
Ember.$(el).remove();
}
//[...]
Give me all I need.
Thanks for your time.
from ember-dragula.
Related Issues (17)
- Integrating with ember-cli HOT 6
- npm version doesn't match repo HOT 1
- bower dependency not included HOT 3
- Unable to set `mirrorContainer` option HOT 7
- The Broccoli Plugin: [SourceMapConcat: Concat: Vendor /assets/vendor.js] failed HOT 7
- Dragging between lists? Nested lists? Wanna build a sortable tree HOT 1
- Upgrade readme with how to run the dummy app. HOT 1
- Can not drop nested items
- Problems with Ember 2.10 HOT 9
- Deprecation with using component lifecycle hook arguments HOT 1
- Fastboot compatibility is still an issue HOT 1
- Load dragula from NPM instead of Bower HOT 5
- Fix breaking changes in FastBoot 1.0
- Publish the latest to npm HOT 2
- Nested components conflict with parent view HOT 4
- blank config doesn't work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-dragula.