Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckboxList #13

Closed
jesusmavarezaskblue opened this issue Jul 13, 2017 · 5 comments
Closed

CheckboxList #13

jesusmavarezaskblue opened this issue Jul 13, 2017 · 5 comments

Comments

@jesusmavarezaskblue
Copy link

jesusmavarezaskblue commented Jul 13, 2017

Good morning,

I need your help please about how to implement in a table, a component CheckboxList. The idea is that you can select inside a checkbox that belongs to a table, different items and that are shown in the same table. I can select one or more. In advance thank you very much for the help.

@linb
Copy link
Owner

linb commented Jul 13, 2017

Sorry , I cant get your point. Can you give me more detail, or upload some pictures to explain your requirement.

@jesusmavarezaskblue
Copy link
Author

It´s a Table like this with a comboBox multibycheckbox. Can you see the image correctly ?
image_1

@linb
Copy link
Owner

linb commented Jul 14, 2017

xui.Class('App', 'xui.Module',{
Instance:{
iniComponents : function(){
// [[Code created by CrossUI RAD Studio
var host=this, children=[], append=function(child){children.push(child.get(0));};

        append(
            xui.create("xui.UI.Dialog")
            .setHost(host,"xui_ui_dialog1")
            .setLeft("7.5em")
            .setTop("1.6666666666666667em")
            .setWidth("35.833333333333336em")
            .setHeight("20em")
            .setCaption("Customized Editor")
            .setMinBtn(false)
            .setMaxBtn(false)
        );
        
        host.xui_ui_dialog1.append(
            xui.create("xui.UI.Block")
            .setHost(host,"xui_ui_block2")
            .setDock("fill")
            .setLeft("2.5em")
            .setTop("2.5em")
            .setBorderType("inset")
            .setBackground("#FFFFFF")
            );
        
        host.xui_ui_block2.append(
            xui.create("xui.UI.TreeGrid")
            .setHost(host,"xui_ui_treegrid2")
            .setLeft("0em")
            .setTop("0em")
            .setRowNumbered(true)
            .setEditable(true)
            .setRowHandler(false)
            .setHeader([{
                "id":"col3",
                "caption":"col3",
                "width":"16em",
                "type":"label"
            }])
            .setRows([{
                "cells":[{
                    "value":"item1"
                }]
            },
            {
                "cells":[{
                    "value":"item2"
                }]
            }])
            .beforeIniEditor("_xui_ui_treegrid2_beforeinieditor")
            .onBeginEdit("_xui_ui_treegrid2_onbeginedit")
            .beforeEditApply("_xui_ui_treegrid2_beforeeditapply")
            .onEndEdit("_xui_ui_treegrid2_onendedit")
            );
        
        append(
            xui.create("xui.UI.List")
            .setHost(host,"xui_ui_listeditor")
            .setDirtyMark(false)
            .setShowDirtyMark(false)
            .setItems([{
                "id":"item1",
                "caption":"item1"
            },
            {
                "id":"item2",
                "caption":"item2"
            },
            {
                "id":"item3",
                "caption":"item3"
            },
            {
                "id":"item4",
                "caption":"item4"
            }])
            .setLeft("35.833333333333336em")
            .setTop("24.166666666666668em")
            .setWidth("19.166666666666668em")
            .setSelMode("multi")
            .setLabelSize("8.333333333333334em")
            .setLabelPos("none")
            .setValue("")
            .afterValueSet("_xui_ui_listeditor_aftervalueset")
        );
        
        return children;
        // ]]Code created by CrossUI RAD Studio
    },

    _xui_ui_treegrid2_beforeinieditor:function (profile, cell, cellNode, pNode, type){
        var ns = this, 
            list = ns.xui_ui_listeditor,
            ce = list.getRoot();
        
        list.setValue( cell.value||"" );

        ce.popToTop(cellNode);
        list.setTagVar( cell );
                    
        ce.setBlurTrigger(xui.id(),function(){
            ce.hide();
            list.setTagVar( null );
        });
        ce.onKeydown(function(){
            ce.hide();
            list.setTagVar( null );
        },'esc');
        
        return false;
    },
    _xui_ui_treegrid2_onbeginedit:function (profile, cell, editor, type){
        var ns = this;
    },
    _xui_ui_treegrid2_beforeeditapply:function (profile, cell, options, editor, tag, type){
        var ns = this;
    },
    _xui_ui_treegrid2_onendedit:function (profile, cell, editor, type){
        var ns = this;
    },
    _xui_ui_listeditor_aftervalueset:function (profile, oldValue, newValue,force, tag){
        var ns = this, cell = ns.xui_ui_listeditor.getTagVar();
        if(cell){
            ns.xui_ui_treegrid2.updateCell(cell,{
                value:ns.xui_ui_listeditor.getValue(true)
            });
        }
    }
}

});

@linb
Copy link
Owner

linb commented Jul 14, 2017

@linb linb closed this as completed Jul 14, 2017
@jesusmavarezaskblue
Copy link
Author

jesusmavarezaskblue commented Jul 14, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants