ActiveList view

Hi

I have created activelist view and added edit, save button. When I click on save button, multiple click events are getting fired. Can you please help me in finding where things are going wrong, here is code snippet

var article_form =
            [
                { id: "title_input", view: "textarea", label: "Title", labelAlign: "left", labelPosition: "top",height:80, width: 600,placeholder: "Enter a Title",inputHeight:40 },
                { id: "add_ticker",  view: "textarea", label: "Ticker", height: 80, width: 600, labelAlign: "left", labelPosition: "top", placeholder: "eg. INTC,MSFT", inputHeight: 40 },
                { id: "data_input", view: "textarea", height: 800, width: 700,label: "Post", placeholder: "Type article here",labelPosition: "top", css: "data_area" },
                {
                    cols:  [
                            { id: "art_save_button", view: "button", value: "Save", width: 200, click: save_button_clicked },
                            { id: "art_post_button", view: "button", value: "Post", width: 200, click: post_button_clicked }
                          ]
                }
            ];

            article_layout_obj = webix.ui(
                {
                    container: article_post_layout,
                    borderless: true,
                    css: "article_layout",
                    height:1100,
                    rows:
                            [
                                { view: "form", scroll: false, width: 1000, elements: article_form }
                            ]
                    
                });

Hi again,

But I don’t see any usage of the activelist here - only a simple form with common buttons. Could you share a snippet that will represent the issue?

Hi Listopad,

I am extremely sorry for spelling mistake, In the above code I am getting multiple save_button_clicked events…

Then, please make sure that

  • you are using the latest version (similar issue was in one of older builds);
  • webix.js is included once in your index.html

Hi Listopad,

I got the same behaviour with following code, it may help you…

 //This display articles that are in save or review mode,
            //we need to prepare data for dashboard layout
            console.log("In create_review_dashboard");


            if (review_dashboard_obj != null || review_dashboard_obj != undefined)
                review_dashboard_obj.clearAll();

            var data_set = load_data_elements_for_review_dashboard();

            /*Create new view that extends List and webix.ActiveContent*/
            webix.protoUI({
                name: "activeList"
            }, webix.ui.list, webix.ActiveContent);


            review_dashboard_obj = webix.ui({
                view: "activeList",
                id: dashboard_list,
                container: review_dashboard_id,
                width: 1000,
                autoheight: true,
                select: true,
                data: data_set,
                height: 1000,
                css: "dashboard_layout",
                activeContent: {
                    commentButton: {
                        id: "commentButtonId",
                        view: "button",
                        label: "Resubmit",
                        width: 80
                        //click: commentClick
                    },
                    publishButton: {
                        id: "publishButtonId",
                        view: "button",
                        label: "Publish",
                        width: 80,
                        click: publishClick
                    },
                    previewButton: {
                        id: "previewButtonId",
                        view: "button",
                        label: "Preview",
                        width: 80,
                        click: previewClick
                    },
                    rejectButton: {
                        id: "rejecteButtonId",
                        view: "button",
                        label: "Reject",
                        width: 80,
                        click: rejectClick
                    },
                },
                on: {

                    onBeforeLoad: onBeforeLoadImpl_review_dashboard,
                    onAfterLoad: onAfterLoadImple_review_dashboard

                },
                template: "<div class='created_on_css'>#Created_on#<br>#ticker#</div><div class='title_css' title='Title'>#title#</div>" +
                          "<div class='status_css' title='Status'>#status#</div>" +"<div class='author_css' title='Author'>#author#</div>" +
                          "<div class='buttons'>{common.commentButton()}</div><div class='buttons'>{common.publishButton()}</div><div class='buttons'>{common.previewButton()}</div><div class='buttons'>{common.rejectButton()}</div>"
                                                    ,
                type: {
                    height: 65
                }

            });

            $$("commentButtonId").attachEvent("onItemClick", commentClick);

We still cannot reproduce your issue and there’re no any known reasons except mentioned before. If you can show it in our snippet tool, please, post an example. But for now, I can only suggest that the problem is not in Webix.

As for the activeContent, there’s exists an antithetical bug - buttons are not always working. Here’s a sample without it:

http://docs.webix.com/samples/05_list/14_custom_handlers.html