Code Monkey home page Code Monkey logo

webix's Introduction

Webix UI v.10.2.0

npm version

https://webix.com

If you don't know where to start - check

Demos

Check https://webix.com/demos

License terms

Webix UI library is licensed under "GPL v3" licence http://www.gnu.org/licenses/old-licenses/gpl-3.0.html

Starting from Webix 2.4, it possible to use a FLOSS Exception to the GPL License. This allows to use Webix in your applications distributed under MIT, BSD and other open source licenses.

What the license means in layman terms

  • You CAN'T remove this license or webix attribution from source files
  • You CAN modify provided code in any way which doesn't conflict with above statement
  • You CAN use this lib for any private projects which you do not plan to share or sell
  • You CAN use this lib for public projects, BUT in such case you MUST share the full client source code of your project if asked
  • If you do not want to share sources then you need to obtain a commercial license

Commercial license and Support

You can buy a commercial license and support subscription at https://webix.com

If you have questions about functionality of the component or have some issue with API and behavior of the component, you can get help at https://forum.webix.com

(c) XB Software Ltd. 2023

webix's People

Contributors

dandv avatar kullias avatar mbombonato avatar mkozhukh avatar zwillinge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webix's Issues

ui.radio setValue does not update display to match setValue

Not sure this behavior is intentional or not, but after setting the value the component needs to refreshed so the css class change takes effect. Selection does not change visually without the refresh.

setValue('A');
refresh();//this is needed to update display,

Special chars break templating

If text contains special html chars ( < > & ) the result view can be broken, as values are injected as is, without escaping.

Disable for input tags

Right now "disable" api is disabling parent element of input components, but not input tags inside it.

Accordion resize

Accordion doesn't resize when changed size a component inside it .

Bug: DataTable/TreeTable working with hidden columns not transparent.

eachColumn : iterates over all columns in the table
http://docs.webixui.com/api__link__ui.treetable_eachcolumn.html

Hidden columns is not iterated. (If there were included a way to tell if they were visible or not would be desirable) My suggestion would be take a param, visible. null = all column, false only hidden columns, true only visible columns.

Other column collections only contain visible columns, not a problem if api allows ways to access these.

getColumnConfig will not return hidden columns.
.

Button disable (Label click event still active ie:10)

Appears in IE 10, chrome appears to behave correctly.

{ view:"button", id:"homeButton", type:"imageButtonTop", label:"Home", borderless:false, css:"smallerFont",
image:"../hpia3/webimages/home_32.gif", width:92},

$$('homeButton').disable();

The label portion "Home" remains enabled and events are passed for click event.

(Side Note Disabled button is not extremely obvious, dimming the actual graphic/label would help out a lot)
This appears to be a css issue and as well related to the IE bug. Changing that line in css appears to fix the IE issue, and make the icon dimmed as well in chrome.

.webix_view.webix_control>.webix_disabled {
background-color: #ddd;
}

Bug: TreeStore each method broken latest release (7/2/2013)

In the latest release appears TreeStore iterates objects differently, as of now it's just broken.

In TreeStore this was changed.
eachChild:function(id, functor, master){
if (this.branch[id])
return webix.PowerArray.each.call(this.getItem(this.branch[id]), functor, master||this);
//return webix.PowerArray.each.call(this.branch[id], functor, master||this);
},

Commented out is the old code that did work, more has changed than just that lines as putting it back in does not work as expected. The problem is caused by this.getItem(this.branch[id]) as the variable is an array of all the highest level items on a TreeStore.

DataStore, changing to this method fixes the issue, it works but am not sure is the best solution to fix this issue.
getItem:function(id){
if( Object.prototype.toString.call( id ) === '[object Array]' ) {
var items = [];
for (var i = 0; i < id.length; i++) {
items[items.length] = this.pull[id[i]]
}
return items;
} else {
return this.pull[id];
}
},

******** Code to reproduce the issue ********
treeTable = new webix.ui({
container:"testA",
view:"treetable",
columns:[
{ id:"value", header:"Film title", width:250, template:"{common.treetable()} #value#", format:testing},
{ id:"id", header:"", css:{"text-align":"right"}, width:50, format:testing},
],
data: [
{ "id":"1.1", "value":"Part 1", "chapter":"alpha"},
{ "id":"1.2", "value":"Part 2", "chapter":"beta"}
],
});
treeTable.data.each(
function(obj){
webix.message(obj.value);
}
);

Touch Based Multiselect Behavior

TreeGrid
DataGrid
List

Seems like on these components when webix.env.touch is true, each selection should be preserved. There is no way to select multiple selections otherwise. Changing this would only affect components that have multiple selections.

webix.env.touch ? true : e.ctrlKey

Seems to work well in several spots on touch based devices. Large lists are difficult just because of touch based nature. Other suggestion i would have would be like a hard touch where it enables you to just swipe your finger and select items, And tapping off of the component returns it to where you can scroll across it.

Lack of tree API

There is no API to uncheck all items
There is no API to set checked items and ask component to update 3-state checkboxes through all tree.

template attribute in xml

Template attribute is ignored during initialization from XML ( tags content always overwrite it )

Confirmed for dataview

TreeTable adjustColumn does not account width correctly for multiple levels

K is cut off on Shawshank. Depending on number of levels and width of data, width can be alot further off. _getColumnConfigSize is the method where the issue lives, and where max width on row items is calculated appears to be where the issue is, var d's children appears to have wrong sizes for the webix_tree_none, close, open.

**** Sample Code to produce issue *******

<body>
    <div class='header_comment'>Loading plain ('one-level') JSON data and grouping in nodes on the client side</div>
    <div id="testA" style='width:250px; height:250px; float:left'></div>
    <script type="text/javascript" charset="utf-8">

    webix.ready(function(){
        grida = new webix.ui({
            container:"testA",
            view:"treetable",
            columns:[
                { id:"value",   header:"Film title",    width:250, template:"{common.treetable()} #value#" },
                { id:"id",  header:"", css:{"text-align":"right"},      width:50},
                { id:"chapter", header:"Mode",  width:200}
            ],
            autoheight:true,
            autowidth:true,

            data: [
                { "id":"1", "value":"The Shawshank", "open":true, "data":[
                    { "id":"1.1", "value":"Part 1", "chapter":"alpha"},
                    { "id":"1.2", "value":"Part 2", "chapter":"beta", "open":true, "data":[
                        { "id":"1.2.1", "value":"Part 1", "chapter":"beta-twin"},
                        { "id":"1.2.2", "value":"Part 1", "chapter":"beta-twin"},
                    ]},
                    { "id":"1.3", "value":"Part 3", "chapter":"gamma" }
                ]},
                { "id":"2", "value":"The Godfather", "data":[
                    { "id":"2.1", "value":"Part 1", "chapter":"alpha" },
                    { "id":"2.2", "value":"Part 2", "chapter":"beta" }
                ]}
            ]
        }); 
        grida.adjustColumn("value", true);
    });
    </script>
</body>

Datatable in MultiView

If the DataTable has "fillspace" for one of its columns and created inside MultiView, left position of columns is not calculated correctly.

Checkboxes work incorrect for menu items hide-n-show

  1. Check any parent branch with its children - corresponding parent and children disappear in menu - ok.
  2. Uncheck parent - corresponding parent item becomes visible in menu - ok. Its children also become visible in menu - bug.

sample:
/03_menu/10_hide_item.html

Window (Show then Hide doesn't work if done in same method)

Not sure this a bug or just a it is what it is thing.

If you popup a window for some data processing that happens then close that window right afterwards the window remains open and will not close. As a work around you can create a timer to execute hide delayed afterwards.

Code to recreate would be just in the same method.
$$("dataLoad").show();
$$("dataLoad").hide();
with a basic window. Behavior you would expect is for window to be closed.

Bug: Loading data from DataCollection on List component (.DataCollection itself shows on List as an item)

This maybe present in more components than List. Below is example code to reproduce the bug. Happens with objects or an array of strings. Also happens with loading from url vs inline datacollection.

This will result in 2 items in the List showing, it seems to count the DataCollection as an item as name shows DataCollection in the list.

    <body>
        <div id="testA" style='width:250px; height:250px; float:left'></div>
        <script type="text/javascript" charset="utf-8">

        var bookmarks = new webix.DataCollection({
            data: [
                    { name:"name 1", desc:"test 2"}
                ]
        });


        webix.ready(function(){
                grida = new webix.ui({
                    container:"testA",
                    data:bookmarks,
                    view:"list",
                    template:"#name# #desc#"
            }); 
        });
        </script>
    </body>

Datatable markup init fails

Datatable isn't shown during markup initialization (though html is created for it), even with static container sizing.

15_datatable/23_html_only/01_init.html
as well as other samples from this folder.

At the same time, samples from 23_markup folder work fine.

validation rules bug

Не срабатывает проперть $all в rules формы. (для staff manager)

CheckBox labelRight overflow issue if container too small

On a list component items that are too long are hidden so the text doesn't wrap or display ugly.

If a Checkbox has a labelRight that is too long for the container it will not hide the overflow and the html will wrap making it display ugly.

Example:

var filterPanelScrollView = { 
        view:"scrollview",
        id:"scrollViewComponent",
        width:160,
        body:{
            view:"accordion",
            multi:true,
            id:"filterPanelAccordion",
            rows:[{ type:"space" }]
        },
        scroll:"y"
  };

webix.ready(function(){
    webix.ui(filterPanelScrollView);

    var itemElements = new Array();
    itemElements[0] = { view:"checkbox", labelRight:"Normal", value:0, labelAlign:"left", labelWidth:0};
    itemElements[1] = { view:"checkbox", labelRight:"Stage 1 Hypertension", value:0, labelAlign:"left", labelWidth:0};
    itemElements[2] = { view:"checkbox", labelRight:"Stage 2 Hypertension", value:0, labelAlign:"left", labelWidth:0};
    var template = {header:"Blood Pressure", body:{view:"form", elements:itemElements}}

    var accordion = { view:"accordion", multi:true, rows:[template] };
    $$("filterPanelAccordion").addView(accordion , $$("filterPanelAccordion").getChildViews().length);
});

Bug: TreeTable leftSplit doesn't allow horizontal scrolling by click

Without a leftSplit (probably same is true for rightSplit and same with rows) you can click left or right of the scrollbar and the columns will scroll left or right. With the left split, scrolling doesn't respond except for clicking and dragging the scrollbar.

<body>
    <div class='header_comment'>Loading plain ('one-level') JSON data and grouping in nodes on the client side</div>
    <div id="testA" style='width:250px; height:250px; float:left'></div>
    <script type="text/javascript" charset="utf-8">

    webix.ready(function(){
        grida = new webix.ui({
            container:"testA",
            view:"treetable",
            columns:[
                { id:"value",   header:"Film title",    width:250, template:"{common.treetable()} #value#", format:testing},
                { id:"id",  header:"", css:{"text-align":"right"},  width:50, format:testing},
                { id:"chapter", header:"Mode",  width:200},
                { id:"chapter", header:"Mode",  width:200},
                { id:"chapter", header:"Mode",  width:200},
                { id:"chapter", header:"Mode",  width:200},
                { id:"chapter", header:"Mode",  width:200},
                { id:"chapter", header:"Mode",  width:200},
                { id:"chapter", header:"Mode",  width:200},
                { id:"chapter", header:"Mode",  width:200}
            ],
            autoheight:true,
            width:500,
            //autowidth:true,
            leftSplit:1,
            data: [
                { "id":"1", "value":"The Shawshank", "open":true, "data":[
                    { "id":"1.1", "value":"Part 1", "chapter":"alpha"},
                    { "id":"1.2", "value":"Part 2", "chapter":"beta", "open":true, "data":[
                        { "id":"1.2.1", "value":"Part 1", "chapter":"beta-twin"},
                        { "id":"1.2.2", "value":"Part 1", "chapter":"beta-twin"},
                    ]},
                    { "id":"1.3", "value":"Part 3", "chapter":"gamma" }
                ]},
                { "id":"2", "value":"The Godfather", "data":[
                    { "id":"2.1", "value":"Part 1", "chapter":"alpha" },
                    { "id":"2.2", "value":"Part 2", "chapter":"beta" }
                ]}
            ]
        }); 
        grida.adjustColumn("value", true);
    });

    function testing(value) {
        webix.message("Calling format function:" + value);
        return "TEST";
    }
    </script>
</body>

Behavior changed in Version 1.01 with ScrollView or Accordian

Code below works fine in 1.0 or build before it. In 1.01 or august 9th's build this is incorrect. Elements align horizontally vs vertically with new build. Was not able to identify what is causing it, below is an example. My guess is that the _vertical_orientation is not setting correctly on the layout or addView doesn't account for it anymore.

    var filterPanelScrollView = { 
            view:"scrollview",
            id:"scrollViewComponent",
            body:{
                view:"accordion",
                multi:true,
                id:"filterPanelAccordion",
                rows:[{ type:"space" }]
            },
            scroll:"y"
      };

  var filterPanel = {
            id:"filterPanel",
            view:"accordion",
            multi:true,
            cols:[ { header:"Filters", view:"accordionitem", id:"filterPanelLayoutAccodrion", body:filterPanelScrollView } ]
        };

  var ui_scheme={
         type:"line", id:"mainReportViewArea", view:"layout", width:200, cols:[ 
              filterPanel
          ]
        };  


    webix.ready(function(){
        webix.ui(ui_scheme);

        for (var i = 0; i < 10; i++) {          
            var listControl = {
                    view:"list",
                    autoheight:true,
                    scroll:false,
                    select:"multiselect",
                    data:["adfasdf", "asdfas","tets"]
            };

            template = {header:"header:" + i, body:listControl};
            var accordion = { view:"accordion", multi:true, rows:[template] };
            $$("filterPanelAccordion").addView(accordion , $$("filterPanelAccordion").getChildViews().length);
        }
    });

Bug: Checkbox with rightLabel can't be left justified/aligned

The issue can be seen in this example
http://docs.webixui.com/samples/13_form/01_controls/06_checkbox.html
on the Third Age labeled checkbox. If you need to get the checkbox to line up on the left, it is not possible as the regular left label is created with a width of the label width. The code to leave out that left label requires label to be null, this is not possible cause of how labelRight is handled.

Below is the code, i modified by commenting out the line to create the left label, which appears to work great. I would assume that line was put in so checkbox's would line up nicely on the form, if there was no text for the left label, like in the example, but i didn't see a way to omit that label with how it is currently coded.

webix.protoUI({
name:"checkbox",
defaults:{
template:function(config, common) {
var id = config.name || "x"+webix.uid();
var rightlabel = "";
if (config.labelRight){
rightlabel = ""+config.labelRight+"";
//config.label = config.label || " ";
}

        var ch = "<div style='line-height:"+common._settings.cheight+"px' class='webix_inp_checkbox_border webix_el_group'>" + 
            "<input style='margin-top:"+Math.floor((common._settings.aheight-16)/2)+"px' id='"+id+"' type='checkbox' "+(config.value?"checked='1'":"")+"/>" + 
            rightlabel+"</div>";
        return common._render_input(config, ch, 0, id);
    }
},

TreeTable adjustColumn does not account width correctly for header. (Chrome only)

This is a fairly small isolated issue, that I've only seen in Chrome (IE and iOS are fine in my testing). The below code will cause the issue where the 2nd column's name word wraps and doesn't show. Changing spaces to %nbsp; seems to fix the issue and it only seems to happen on the 2nd column.

    var bookmarks = new webix.DataCollection({
        data: [
                { "id":"1", "value":"100%", "open":true, "data":[
                    { "id":"1.1", "value":"20%", "chapter":"alpha"},
                    { "id":"1.2", "value":"10%", "chapter":"beta", "open":true, "data":[
                        { "id":"1.2.1", "value":"15%", "chapter":"beta-twin"},
                        { "id":"1.2.2", "value":"20%", "chapter":"beta-twin"},
                    ]},
                    { "id":"1.3", "value":"10%", "chapter":"gamma" }
                ]},
                { "id":"2", "value":"50%", "data":[
                    { "id":"2.1", "value":"25%", "chapter":"alpha" },
                    { "id":"2.2", "value":"10%", "chapter":"beta" }
                ]}
            ]
    });


        grid = new webix.ui({
            container:"testA",
            view:"treetable",
            columns:[
                { id:"id",  header:"ID value", template:"{common.treetable()} #id#"},
                { id:"value",   header:"% Scripts"},
                { id:"value",   header:"% Scripts"},
                { id:"value",   header:"% Scripts"}
            ],
            autoheight:true,
            autowidth:true,
            data:bookmarks.serialize()
        });     

        grid.eachColumn(function(col) {
                grid.adjustColumn(col, true);
        });
        grid.refreshColumns();

BUG: DataTable/TreeTable adjustColumn with headers

Having a datatable or treetable configured and calling adjustColumn(columnId, true) will cause an error.

_getColumnConfigSize:function(ind, headers) references a null object

    if (headers)
    for (var i=0; i<config.headers.length; i++){
        var header = config.headers[i].text;
        d.innerHTML = header;
        max = Math.max(d.scrollWidth, max);
    }

should be

    if (headers)
    for (var i=0; i<config.header.length; i++){
        var header = config.header[i].text;
        d.innerHTML = header;
        max = Math.max(d.scrollWidth, max);
    }

Confirmed works

Enhancement: DataTable/TreeTable visibility of Columns

Would it be possible to throw this in the codebase.
isColumnVisible:function(id) {
return webix.isUndefined(this._hidden_column_hash[id]) ? true : false;
},
around line 17,000ish right above hideColumn or so.


Would it also be possible to throw in column configs a visible:true/false variable to set the column as visible on creation? This config option would also need to stay in sync with the visibility of the column.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.