import {Widget, EqContext, WidgetGroup } from '@easyquery/core'

declare var jQuery:any;

export class JQueryColumnsPanelWidget extends Widget {
    private jqueryWrapper : any;

    constructor(slot : HTMLElement) {
        super(slot);

        this.jqueryWrapper = jQuery(slot);

        this.widgetType = "columnsPanel";
        this.group = WidgetGroup.Query;
    }

    public init(context : EqContext, options?: any) {    
        super.init(context, options);          
       
        this.jqueryWrapper.ColumnsPanel(options)
        this.jqueryWrapper.ColumnsPanel("setQuery", this.context.getQuery());
    }

    protected refreshCore() {
        this.jqueryWrapper.ColumnsPanel("refresh");
    }  
}