README.md

Adding to DragulaR's drag and drop functionality by including the ability to clone blocks with selectInputs in the drop space

Shiny:

The javascript function refreshDragulaR is invoked in the observer for the input$dragula$Model.

JavaScript:

Iterate over all the child elements of the Model element and append a value to their ID tag based on their index in the list (ONE becomes ONE-1, ONE-2, ONE-3 etc.). This re-writes the dropped items such that each has a unique ID.

Because the select inputs are being manipulated by JavaScript, we need a change event callback on the JavaScript side that updates a object with values of the select items when they change, and then triggers a Shiny input event on the group of values.

On the shiny side you can use input$groups to get the whole structure containing all ID/value pairs for any select inputs in the Drop area, and input$groups_change for the ID of the last select item that was changed.



MayaGans/dragulaR documentation built on Jan. 2, 2020, 2:55 a.m.