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

declare var jQuery: any;

export class JQueryColumnsBarWidget extends Widget {

    private jqueryWrapper: any;

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

        this.jqueryWrapper = jQuery(slot);

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

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


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

}