1. #11
    Ext User
    Join Date
    Aug 2008
    Location
    Johannesburg
    Posts
    6
    Vote Rating
    0
    Waldo is on a distinguished road

      0  

    Smile


    Thanks Condor.

  2. #12
    Ext User agodinhost's Avatar
    Join Date
    Aug 2008
    Location
    Rio de Janeiro.
    Posts
    25
    Vote Rating
    0
    agodinhost is on a distinguished road

      0  

    Default


    Really cool!!!

    I found what I think is an issue: it's ignoring the keyboard seletion.

    Woody

  3. #13
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    83
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Yes, I know.

    I'm thinking about writing a CheckColumn and a RadioColumn that can actually be focussed and handle key events, but it's a lot of work, so I don't know when I'll get around to it.

  4. #14
    Ext User agodinhost's Avatar
    Join Date
    Aug 2008
    Location
    Rio de Janeiro.
    Posts
    25
    Vote Rating
    0
    agodinhost is on a distinguished road

      0  

    Default


    Condor, I'm not sure if it will be really healthy, seems that js have a lot of limitations on this subject. I did some research in order to see how to fix that and seems that it will be really hard work and, IMO, don't worth the time that we could spend on it.

    Goggle for 'javascript keyboard limitations' and you will see what I'm talking about (maybe js 1.6 or 1.7 fix that, but who knows?)

  5. #15
    Ext User
    Join Date
    Sep 2008
    Posts
    8
    Vote Rating
    0
    Prodepa is on a distinguished road

      0  

    Default Smarty and RadioColumn

    Smarty and RadioColumn


    I'm utilizing smarty for get my datas and need send the values of the radios(RadioColumn) by your name.
    i.e:
    Html
    Code:
    ....
    var answers = [
            new Ext.grid.RadioColumn({header: 'Yes', inputValue: 1, dataIndex: 'answer', width: 75, align: 'center', sortable: true}),
            new Ext.grid.RadioColumn({header: 'NO', inputValue: 2, dataIndex: 'answer', width: 75, align: 'center', sortable: true}),
            new Ext.grid.RadioColumn({header: 'NA', inputValue: 3, dataIndex: 'answer', width: 75, align: 'center', sortable: true})
        ];
        var columns = [
            {header: 'Item', dataIndex: 'item', width: 100, sortable: true}
        ].concat(answers);
    ...
    RadioColumn.js
    Code:
    <div name="valueTosmarty" class="x-grid3-check-col'+(v?'-on':'')+' x-grid3-cc-'+this.id+'"> </div>
    Action.php
    Code:
    ...
    $...= $_request['valueTosmarty'];
    ...
    how can I do that?
    Please help me out on this.

    p.s: My english very poor

  6. #16
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    83
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Quote Originally Posted by Prodepa View Post
    how can I do that?
    I'm afraid I don't understand the question...

    Are you asking how to send the changes in a grid with radio columns to the server?

    Code:
    params = {};
    grid.getStore().each(function(r) {
      params['answer[' + r.get('item') + ']'] = r.get('answer');
    });
    Ext.Ajax.request({
      url: 'action.php',
      params: params,
      success: function() {...},
      failure: function() {...}
    });

  7. #17
    Ext User
    Join Date
    Sep 2008
    Posts
    8
    Vote Rating
    0
    Prodepa is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    I'm afraid I don't understand the question...

    Are you asking how to send the changes in a grid with radio columns to the server?

    Code:
    params = {};
    grid.getStore().each(function(r) {
      params['answer[' + r.get('item') + ']'] = r.get('answer');
    });
    Ext.Ajax.request({
      url: 'action.php',
      params: params,
      success: function() {...},
      failure: function() {...}
    });
    Is it!! thk's Condor, but i dont understand this solution...

    To be more clear my doubt:

    My Html is:
    Code:
    <{* Smarty *}>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt" lang="pt">
    <head>
    <{include_php file="templates/analisedoc/html_header.html"}>
    
    <script type="text/javascript">var msg = '<{$msg}>';</script></head>
    <script type="text/javascript" src="templates/analisedoc/js/jquery.js"></script>
    <div id="barraTopo"></div>
    
    <div id="container">
        <div id="topo">
            <h1><{include_php file="templates/analisedoc/html_topo.html"}></h1>
        </div>
        
        <div id="content_top">
            <div id="menu"><{include_php file="templates/analisedoc/html_menu.html"}></div>
            <div id="legend"><{$user->nome}></div>
        </div>
        <div id="content">
            <h2>Document</h2>
            
            <form id="form1" name="form1" action="?do=AnaliseDoc.submit" method="post">
                <input type="hidden" name="action" value="<{$action}>"/>
                <input type="hidden" name="hdIdAnaliseDocument" value="<{if $oAnaliseDoc}><{$oAnaliseDoc->id}><{/if}>"/>
                <input type="hidden" name="hdStatus" value="<{if $oAnaliseDoc}><{$oAnaliseDoc->status}><{else}>1<{/if}>"/>
                <input type="hidden" name="hdUsuarioInc" value="<{if $oAnaliseDoc}><{$oAnaliseDoc->usuarioInc->id}><{else}><{$user->id}><{/if}>"/>
                <div id="grid-grid" class="div_line">
                </div>
                <div class="div_line_bottom">
                    <span class="button"><button type="submit"  id="idSubmit" value="Save" onclick="javascript: clickAction('A');">Save</button></span>
                    <span class="button"><button type="button" value="back" onclick="window.location.href='?do=AnaliseDoc';">Back</button></span>
                </div>
            </form>
            
        </div>    
    </div>
    <script>
    //Form with radio button OK
    Ext.onReady(function(){
    
        Ext.QuickTips.init();
        Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
        
        // turn on validation errors beside the field globally
        Ext.form.Field.prototype.msgTarget = 'side';
    
        //   Define the Grid data and create the Grid
        var myData = <{$myData}>;
    
        
             
        var store = new Ext.data.Store({
            reader: new Ext.data.ArrayReader({}, [
                   {name: 'id'},
                   {name: 'qst'},
                   {name: 'answ'}
              ])
        });
        
        var rt = Ext.data.Record.create([
            {name: 'id'}, //name = name by which the field is referenced within the Record
            {name: 'item'},  //type = how the data should be displayed
            {name: 'answ'}
             ]);
    
        var myReader = new Ext.data.ArrayReader({
                     id:0 //could have maybe used 'recordID' (some unique key to the data)
                     }, 
                     rt //the recordType object containing the field mapping
             );
    
        var store = new Ext.data.Store({
             reader: myReader
            });
        
        
        store.loadData(myData);
        
        var answers = [
                         new Ext.grid.RadioColumn({header: 'Yes', inputValue: 1, dataIndex: 'answ', width: 55, align: 'center', editable:true, sortable: false, menuDisable: true}),
                         new Ext.grid.RadioColumn({header: 'NO', inputValue: 0, dataIndex: 'answ', width: 55, align: 'center', editable:true, sortable: false, menuDisable: true}),
                         new Ext.grid.RadioColumn({header: 'NA', inputValue: 2, dataIndex: 'answ',  width: 55, align: 'center', editable:true, sortable: false, menuDisable: true})
                     ];
    
        var questions = [{id: 'id', dataIndex: 'id', hidden:true, sortable: false, menuDisable: true},
                         {id:'qst', header: "Question", width: 406, sortable: true, dataIndex: 'qst'}].concat(answers);
    
        
         var grid = new Ext.grid.EditorGridPanel({
            store: store,
            plugins: answers,
            columns: question,
            width: 571,
            autoHeight: true,
            title:'Questions',
            loadMask:    true,
            //stripeRows: true
            //frame:true,
            sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
        });
        
          dataGrid = grid;
          grid.render('grid-grid')
        
        
      });//END Form with radio button OK
    
    </script>
    
    </body>
    </html>
    A piece of my Action, i utilizing facade method:
    Code:
    //save the itens in the checklist
                                    $typeDesp = $aoAnaliseDocument[0]->typeDesp->id;                        
                                    $aoItemTypeDesp = $fcAnaliseDoc->findItemTypoDesp('ItemTypeDesp.fase = '. $idFaseActual .' and ItemTypeDesp.typeDesp ='. $typeDesp);
                                    
                                    foreach($aoItemTypeDesp as $oItemTypeDesp){
                                        $oChecklistDesp = $fcAnaliseDoc->initializeChecklistTypoDesp();
                                        $oChecklistDesp->analiseDocumentoFase = $ord;
                                        $oChecklistDesp->itemTypeDesp = $oItemTypeDesp->id;
                            --->    //$oChecklistFase->answer = $_request[ 'Y' or '1']; //Is there the value receive of the RadioColumn  <---
                                        $oChecklistDesp->status = $_request['hdStatus'];
                                        $oChecklistDesp->userInc = $_request['hdUserInc'];
                                        $chtd = $fcAnaliseDoc->saveChecklistTypeDesp($oChecklistDesp);
                                    
                                    }
    How get this value from RadioColumn?? pls Again......................

  8. #18
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    83
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    A GridPanel doesn't use <input> tags, so the data won't be submitted with the form.

    You could create an extra hidden input and fill it with the data from the GridPanel, e.g.

    Code:
    <input type="hidden" id="answers" name="answers" value="" />
    ...
    Ext.get('idSubmit').on('click', function(e) {
      e.stopEvent();
      params = {};
      grid.getStore().each(function(r) {
        params[r.get('id')] = r.get('answ');
      });
      Ext.getDom('answers').value = Ext.encode(params);
      clickAction('A');
    });
    ...
    $answers = json_decode($_request['answers']);

  9. #19
    Ext User
    Join Date
    Sep 2008
    Posts
    8
    Vote Rating
    0
    Prodepa is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    A GridPanel doesn't use <input> tags, so the data won't be submitted with the form.

    You could create an extra hidden input and fill it with the data from the GridPanel, e.g.

    Code:
    <input type="hidden" id="answers" name="answers" value="" />
    ...
    Ext.get('idSubmit').on('click', function(e) {
      e.stopEvent();
      params = {};
      grid.getStore().each(function(r) {
        params[r.get('id')] = r.get('answ');
      });
      Ext.getDom('answers').value = Ext.encode(params);
      clickAction('A');
    });
    ...
    $answers = json_decode($_request['answers']);
    In the firebug appeared the following error: json_decode is not defined

  10. #20
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    83
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    This:
    Code:
    $answers = json_decode($_request['answers']);
    is supposed to be processed on the server (part of AnaliseDoc.submit)