1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    15
    Vote Rating
    0
    easytech is on a distinguished road

      0  

    Question grid bind to object

    grid bind to object


    hi, i've a question;
    i'm trying to bind grid to formPanel but how can i convert string value to boolean in binding process?
    i would insert some checkbox in formPanel, and when a grid row is binded i would like to see che chechbox
    selected or unselected

    thank you

    this is my code:

    Code:
    final FormBinding formBindings;
            FormPanel panel = createForm();
            formBindings = new FormBinding(panel, true);
            grid= createGrid();
            formBindings.setStore(grid.getStore());
            grid.setPixelSize(500, 350);
            grid.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
            grid.getSelectionModel().addListener(Events.SelectionChange,
                    new Listener<SelectionChangedEvent<esLogin>>() {
                        public void handleEvent(
                                SelectionChangedEvent<esLogin> be) {
                            if (be.getSelection().size() > 0) {
                                formBindings.bind((ModelData) be.getSelection()
                                        .get(0));
                            } else {
                                formBindings.unbind();
                            }
                        }
                    });
    Code:
    private FormPanel createForm() {
            FormPanel panel = new FormPanel();
            panel.setHeaderVisible(false);
            panel.setHeight(400);
        
            TextField<String> id = new TextField<String>();
            id.setName("id");
            id.setEnabled(false);
            id.setFieldLabel(span + "ID</span>");
            panel.add(id, new FormData(75, 22));
            
            TextField<String> username = new TextField<String>();
            username.setName("username");
            username.setFieldLabel(span +"Username</span>");
            panel.add(username);}

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Set a Converter for the Field in question. This can be done by creating a Converter instance with correct implementations for the two methods to convert between the field and the model, and attaching it to the FieldBinding that it belongs to in the FormBinding.

    formBindings.getBindinging(myBoolField).setConverter(myStringToBooleanConverter);

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi