Sidebar with extra cell

Is there a way to setup additional cells that will not appear as side elements but will be usable to be called from ie. Toolbar? Let’s say I have main application menu in sidebar, but user menu is in Toolbar above. I would like to attach content selected from user menu to sidebar’s separate cell…

Hi

you can try views
docs.dhtmlx.com/sidebar__views.html

I used views to display Scheduler in currently active sidebar cell. It works fine with one exception:

I have the following option set for Scheduler

scheduler.config.scroll_hour = 8;

When I display the scheduler in the view for the first time it works ok, but when I hide the view and rebuild it for the second time it never scrolls to defined hour.

Is there any way to resolve it?

This command instructs scheduler to scroll to the defined mark after view rendering.
So you may need to call scheduler.updateView(); when view with scheduler becomes visible, to force repainting and correct scroll state applying.

Unfortunately it did not help.

I will describe my idea with more details:

I created main layout using sidebar. It works correctly. However I want to invoke scheduler from other place than sidebar - i have popUp menu somewhere else. So I create a view in currently active sidebar’s cell and add scheduler to this view:

[code]var layoutCalendar;

function celendarInit(cell) {
cell.showView(‘kalendarz’);

layoutCalendar = cell.attachLayout('1C');

var toolbarCalendar = layoutCalendar.attachToolbar();
toolbarCalendar.setIconset('awesome');

toolbarCalendar.loadStruct('<toolbar>' +
    '<item type="text" id="button_text_1" text="KALENDARZ" />' +
    '<item type="spacer" id="spacer"/>' +
    '<item type="button" id="buttonCloseCal" img="fa fa-times" imgdis="fa fa-times"/>' +
    '</toolbar>', function() {});
toolbarCalendar.attachEvent('onClick', function(bId) {
    switch(bId) {
        case 'buttonCloseCal':
            scheduler.clearAll();
            cell.showView('def');
            cell.unloadView('kalendarz');
            layoutCalendar = undefined;
            break;
    }
});

if(!scheduler.isViewExists("week")) {
    
    scheduler.config.api_date = '%Y-%m-%d %H:%i';
    scheduler.config.day_date = '%l, %j %M';
    scheduler.config.xml_date = '%Y-%m-%d %H:%i';
    scheduler.config.show_loading = true;
    scheduler.config.last_hour = 24;
    scheduler.config.hour_size_px = 88;
    scheduler.config.details_on_create = true;
    scheduler.config.details_on_dblclick = true;
    scheduler.config.icons_select = ['icon_details', 'icon_delete'];
    scheduler.config.multi_day = true;
    scheduler.config.full_day = true; // enable parameter to get full day event option on the lightbox form
    scheduler.config.include_end_by = true;
    scheduler.config.scroll_hour = 8;
    
    var dp = new dataProcessor("./calendars/plaindata");
    dp.init(scheduler);
}
layoutCalendar.cells('a').attachScheduler();

scheduler.updateView();

}

window.dhx.attachEvent(‘onToolbarSelect’, function(bId, cell) {
if(bId == “kalendarzBtn”) {
calendarInit(cell);
}
});[/code]

In popUp ‘onClick’ event I do the following:

var cell = mainSidebar.cells(mainSidebar.getActiveItem()); window.dhx.callEvent('onToolbarSelect', [bId, cell]);

On ‘close button’ press the view is being destroyed. When I show it again, in the same sidebar’s cell or not, it does not scroll to the hour requested by configuration.

Maybe you have better idea for such behaviour…

Thanks for your support.

Any idea here?

If you have the Enterprise version of DHTMLX Scheduler, you can create multiple instances of a scheduler, which mean you can create a new scheduler each time, so it will not be affected by settings and state of a previous one.

As for the original issue, please share a demo link, if possible. While I understood your use-case, I can’t reconstruct the same issue locally.