cos-archives / hgrid

[UNMAINTAINED] A Javascript-based hierarchical grid that can be used to manage and organize file/folder-like data
Apache License 2.0
23 stars 14 forks source link

[Draggable] Reordering of components #72

Open brianjgeiger opened 10 years ago

brianjgeiger commented 10 years ago

When we want to implement reordering, it looks pretty simple to do. If we can get it in easily, I think people would appreciate it a lot. If not, we set it for a future update. Here's a sample code from the unit test for reordering via the API.

        payload = {'new_list': [
                '{0}:node'.format(self.private_component._primary_key),
                '{0}:node'.format(self.public_component._primary_key),
            ]
        }
        url = lookup('api', 'project_reorder_components', pid=self.project._primary_key)
        res = self.app.post_json(url, payload, auth=self.contrib.auth)