Skip to content
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

More detailed options for 'editable' #26

Closed
poroale opened this issue Jan 22, 2017 · 4 comments
Closed

More detailed options for 'editable' #26

poroale opened this issue Jan 22, 2017 · 4 comments

Comments

@poroale
Copy link

poroale commented Jan 22, 2017

Is it possible to have the possibility to change the group of an item, while disabling the possibility of changing the start / end times? The item should still be deletable.

I mean something like here, where you can edit the 'editable' option in a detailed way:
http://visjs.org/examples/timeline/editing/individualEditableItems.html

var items = new vis.DataSet([
{id: 1, content: 'Editable', editable: true, start: '2010-08-23', group: 1},
{id: 2, content: 'Editable', editable: true, start: '2010-08-23T23:00:00', group: 2},
{id: 3, content: 'Read-only', editable: false, start: '2010-08-24T16:00:00', group: 1},
{id: 4, content: 'Read-only', editable: false, start: '2010-08-26', end: '2010-09-02', group: 2},
{id: 5, content: 'Edit Time Only', editable: { updateTime: true }, start: '2010-08-28', group: 1},
{id: 6, content: 'Edit Group Only', editable: { updateGroup: true }, start: '2010-08-29', group: 2},
{id: 7, content: 'Remove Only', editable: { remove: true }, start: '2010-08-31', end: '2010-09-03', group: 1},
{id: 8, content: 'Default', start: '2010-09-04T12:00:00', group: 2}
]);

@poroale poroale changed the title Dragging item from row to another More detailed options for 'editable' Jan 22, 2017
@daattali
Copy link
Owner

daattali commented Jan 22, 2017 via email

@poroale
Copy link
Author

poroale commented Jan 22, 2017

Thank you for the reply.

The example "Edit Group Only" in http://visjs.org/examples/timeline/editing/individualEditableItems.html is basically what I would need.

@daattali
Copy link
Owner

I see, in that case you should be able to do this by simply translating the javascript options object to R. I haven't tried running this code, but something like this should work:

groups <- data.frame(id = 1:2, content = c("group1", "group2"))
df <- data.frame(id = 1:2,
                 content = c("one", "two"),
                 start = c("2016-01-10", "2016-01-12"),
                 group = 1:2)
timevis(df, groups, options = list(editable = list(updateGroup = TRUE)))

or timevis(df, groups, options = list(editable = list(updateTime = TRUE)))

(I'm getting these editable options from the documentation at http://visjs.org/docs/timeline/

@poroale
Copy link
Author

poroale commented Jan 22, 2017

Ok, I understand. Both your examples work nicely.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants