-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(sortable): add support for custom item template #1554
Comments
yep, need to mark sortable as experimental, some how |
I just made a prototype of this idea, but I need to clarify one thing is it enough? or item template should include |
This looks like enough for my purposes. I would expect the component to still own the .sortable-item 'div' not the template.
…________________________________
From: Dmitriy Shekhovtsov <notifications@github.com>
Sent: Wednesday, January 25, 2017 4:56 AM
To: valor-software/ng2-bootstrap
Cc: dlcooper; Author
Subject: Re: [valor-software/ng2-bootstrap] feat(sortable): add support for custom item template (#1554)
I just made a prototype of this idea, but I need to clarify one thing
please check 5ed3ba4#diff-456830bd92e54b2e7c01693e0f6654af<5ed3ba4#diff-456830bd92e54b2e7c01693e0f6654af>
is it enough? or item template should include .sortable-item'div`?
-
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1554 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AEreuu3ZEjHIXxMZM886-tq1ASgkxX6Hks5rVxw7gaJpZM4Ls49P>.
|
Any more thoughts on the viability of this? Or a timeline for incorporating it in the product?
…________________________________
From: Dmitriy Shekhovtsov <notifications@github.com>
Sent: Wednesday, January 25, 2017 4:56 AM
To: valor-software/ng2-bootstrap
Cc: dlcooper; Author
Subject: Re: [valor-software/ng2-bootstrap] feat(sortable): add support for custom item template (#1554)
I just made a prototype of this idea, but I need to clarify one thing
please check 5ed3ba4#diff-456830bd92e54b2e7c01693e0f6654af<5ed3ba4#diff-456830bd92e54b2e7c01693e0f6654af>
is it enough? or item template should include .sortable-item'div`?
-
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1554 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AEreuu3ZEjHIXxMZM886-tq1ASgkxX6Hks5rVxw7gaJpZM4Ls49P>.
|
I have some urgent things to fix, but tomorrow I hope to get in this |
This is great! It would nice to have a template parameter to compute whether the item is draggable. i.e.
or, you could just call me wrong and make the
as you suggested earlier. |
@dlcooper not sure if I understand you correctly, do you want to make some items in sortable container undraggable i.e. they should always keep their positions? If so when
won't help because you still will be able to drag other items and it can affect positions of disabled items as well (according to current implementation for sure). Or probably you just want to disable whole container? |
For my application it's ok if an item's position changes in a list as long as it can't leave the list, for example:
"List A"
Joe
Bill (draggable=false)
Bob
"List B"
Don
Jim
George
as long as Bill can't leave "List A" it doesn't matter for me whether he's first, second or third in the list.
So, if Bill is in a <div draggable="false">Bill</div> I think that does what I am looking for.
…________________________________
From: Leo <notifications@github.com>
Sent: Thursday, February 2, 2017 4:23 PM
To: valor-software/ng2-bootstrap
Cc: dlcooper; Mention
Subject: Re: [valor-software/ng2-bootstrap] feat(sortable): add support for custom item template (#1554)
@dlcooper<https://github.com/dlcooper> not sure if I understand you correctly, do you want to make some items in sortable container undraggable i.e. they should always keep their positions? If so when
item template should include .sortable-item'div`?
won't help because you still will be able to drag other items and it can affect positions of disabled items as well (according to current implementation for sure). Or probably you just want to disable whole container?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1554 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AEreukcSe9BYUp3Ag5xuXihuJEiFOLYdks5rYklegaJpZM4Ls49P>.
|
@dlcooper OK, I see. It is added to next PR but not sure how long it will take to approve it, it is quite big. |
Custom template support was added in #1580 |
I have a list of cups (complex model) and want a different image for each cup but the API for doesn't seem to support such a concept.
` <bs-sortable
[(ngModel)]="itemObjectsLeft"
fieldName="name"
itemClass="sortable-item"
itemActiveClass="sortable-item-active"
placeholderItem="Drag here"
placeholderClass="sortable-item"
wrapperClass="sortable-wrapper"
class Cup {
type:string
name:string
}
`
Is there a way to do that based on the value of the type property?
Maybe there could be a "template" or "templateRef" Input that would have access to the list item.
Something like:
<bs-sortable [(ngModel)]="myCups" templateRef="cupRenderingTemplate"...> </bs-sortable>
The text was updated successfully, but these errors were encountered: