Filemanager - add single row (like folder)

I would to add simply, dynamic item row to files list (something like "Create empty file"). I created custom menu option to it and everything work good but i have no idea how refresh file list with new item.

Here is my code:

    var actions = manager.getMenu();
    actions.attachEvent("onItemClick", function(id) {
        var context = $$("files").getMenu().getContext();
        if (id === "create") {
            $.ajax({
                url: '/store',
                data: { name: 'Empty file', folder_id: manager.getItem(manager.getCurrentFolder()).oid}
            }).done(function (data) {

                manager.getMenu().hide();
                // and my attempts:
                $$("files").add(data);
                $$("files").parseData(data);
                manager.add(data);
                manager.parseData(data);
            });

            return true;
        }
    });

Comments

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion