Button click or on->onItemClick do not trigger specified function.

I am having a weird problem and was wondering if anybody else has experienced it.
When clicking on my close button the specified function is not triggered. Not even the functions from the example like (“alert(‘handler’);”)

Here is the code i am currently using:

        var self = this;
        var url = listItem.model.get('Filename');
        self.popupWindow = webix.ui({
            view: "window",
            id: "clients-detail-file-window",
            modal: true,
            height: 650,
            width: 900,
            position: "center",
            top: 100,
            bottom: 100,
            head: {
                view: 'toolbar',
                css: 'grey-brd-btm',
                cols: [
                    {
                        view:"label",
                        label: "Bestand",
                        inputWidth: 100,
                        align:"left"
                    },
                    {},
                    {
                        view: "button",
                        label: "Download bestand",
                        inputWidth: 200,
                        align: "right"
                    },
                    {
                        view:"button",
                        id: 'file-window-close-button',
                        label: "X",
                        width: 50,
                        align: "right",
                        on: {
                            'onItemClick': self.fileViewerClose
                        }
                    }
                ]
            },
            body: {
                template: "<iframe src='"+url+"'></iframe>"
            }
        });
        self.popupWindow.show();

Also tried click: self.fileViewerClose both did not trigger anything.
And: click: ‘$$(“clients-detail-file-window”).close();’ same result.

Above code works for me http://webix.com/snippet/cf7b4fc4

Most probably self.fileViewerClose is not defined in your case

Function is definitely defined below it but could it be due to the fact that i am still using 1.6 ?

Edit: nope 1.7 same problem :S

Weird thing is also the fact that when looking at the _evs_events object (within the button) it does list the onitemclick with one listener… though the arguments,caller and name all are empty.

Tried it somewhere else and same problem elsewhere. My buttons do not work even within the backbone WebixView config. Really odd.

Try to use something like

on: {
      'onItemClick': function(id){ 
              alert("Event was called");
              self.fileViewerClose(id);
       }
}

Tried it to no avail. Tried it in JSBin without require.js which seemed to work …

http://jsbin.com/jozuduke/1/

Could it be that the binder (that is called on ready) to bind the click events to a function:

webix.ready(function(){
webix.event(document.body,"click", function(e){
	webix.callEvent("onClick",[e||event]);
});
});

is not called correctly within requireJS? for whatever reason that could be. Since this function (unlike the JSBIN example) is also not called within my application.

There was a problem with RequireJS
Official fix will be included in 1.8.
If you need the fix ASAP - grab the updated package http://goo.gl/Osh44Y

Jup that fixed it thank you :slight_smile: