1. #91
    Ext User
    Join Date
    Sep 2007
    Posts
    104
    Vote Rating
    0
    robin30 is on a distinguished road

      0  

    Default thanks

    thanks


    thank you for your quick reply, really appreciate it.

    i understand what you mean. Gonna try to figure out how the save button works.

    Keep up the good work, thanks for taking your time helping me. really appreciate it.

  2. #92
    Ext User
    Join Date
    Sep 2007
    Posts
    104
    Vote Rating
    0
    robin30 is on a distinguished road

      0  

    Default trying the save button

    trying the save button


    hi all,

    i'm trying to do the save button but i can't seem to get it to work.

    i can change fields, press ok, little red triangle appears but as soon as i click on save a little window shows up and it says "Unknown Error".

    i have apache server + mysql
    objName = bills (i assume this is the table name in my database)
    idName = id (i assume this is the primairy key in my table)
    url='php/database.php'
    cmd='update'

    in my database.php i do have a function called 'update' this is what it looks like:
    PHP Code:
    function update()
    {
        
    $id $_GET['id'];
        
    $name $_POST['name'];
        
    $due $_POST['due'];
       
    $amount $_POST['amount'];
        
    $paid $_POST['paid'];
        
    $paid_when $_POST['paid_when'];
       
    $amount_paid $_POST['amount_paid'];
    if (
    $paid == 'true'){
    $paid '1';
    } else {
    $paid '0';
    }
       
    $result="SELECT * FROM bills where id='$id'";
    $result1=mysql_query($result);
    $rows mysql_fetch_array($result1);
    $amount $rows['amount'];
    $difference $amount_paid $amount;
       
        
    $query "UPDATE bills SET name = '$name', due='$due', amount='$amount', paid='$paid', paid_when='$paid_when', amount_paid='$amount_paid', difference='$difference' WHERE id=$id";
        
    $result3 mysql_query($query);
        echo 
    '1';

    i'm pretty sure here's where i go wrong. can someone please tell me what i'm doing wrong and give a kick in my rearend to the right direction i have to go to make this work?

    thanks,

    regards,

    Robin30

  3. #93
    Ext User
    Join Date
    Sep 2007
    Posts
    104
    Vote Rating
    0
    robin30 is on a distinguished road

      0  

    Default


    firebug is giving me at least something,lol

    PHP Code:
    cmd  update
    data    
    [{"name":"Penele","id":"53"}]
    objName    bills 
    i changed the name of id # 53 so that is correct, but still don't know how to get it changed in my database.

    regards,
    robin30

  4. #94
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,518
    Vote Rating
    376
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Take php from demo page and adjust it. In each step test when it stops to work. BTW, I'd use PDO if possible - saves a lot of headaches.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  5. #95
    Ext User
    Join Date
    Sep 2007
    Posts
    104
    Vote Rating
    0
    robin30 is on a distinguished road

      0  

    Exclamation totally lost

    totally lost


    i looked at the php file,

    i'm using the same files as you do, Saki, now i get a message date or idname missing.

    i'm loosing really sleep over this, .

    i do have a different setup for the grid as you, if i use for example this.idName firefox goes ballastic.

    so i made var out if it all.

    this is my code for the grid:
    PHP Code:
    var grid = new Ext.grid.EditorGridPanel({
        
    id:'lol',
                
    enableColLock:false,
                
    url:'php/database.php',
        
    objName:'bills',
        
    idName:'id',
            
    // sm: new Ext.grid.RowSelectionModel({singlerow:true}),
            
    width:700,
                
    height:500,
            
    dsstore,
                
    cmcm
                
    sm:sm,
                
    plugins: [summaryaction, new Ext.ux.grid.Search({
                    
    iconCls:'icon-zoom'
                    
    ,readonlyIndexes:['all']
                    ,
    disableIndexes:['amount'],
                    
    mode:'local',
                    
    position:'top',
                    
    align:'right'
                
    }), recordForm],
        
    trackMouseOver:false,
            
    loadMasktrue,
            
    frame:false,
            
    viewConfig: {
                
    forceFit:true
            
    },

    bbar: new Ext.PagingToolbar({
                    
    pageSize15,
                    
    storestore,
                    
    displayInfotrue
                
    }),
                
    buttons:[{
                     
    text:'Save'
                    
    ,iconCls:'icon-disk'
                    
    ,scope:this
                    
    ,handlercommitChanges
                
    },{
                     
    text:'Reset'
                    
    ,iconCls:'icon-undo'
                    
    ,scope:this
                    
    ,handler:function() {
                        
    this.store.rejectChanges();
                    }
                }],
         
    tbar:[{
             
    text'Add Bill',
            
    iconCls:'add',
        
    tooltip'Add Bill',
        
    handleraddbillform
            
    },'-',{
            
    text'Delete Bill(s)',
            
    iconCls:'remove',
    tooltip'Delete Selected Bill',
            
    handler:     deleteContextMenu    
    }
    //,'-',{
    //        text: 'Pay Bill',
     //       iconCls:'money',
    //tooltip: 'Pay Selected Bill',
    //        handler: paidbillform
    //}
    ,'-']
            });
            
            
            
    ListingContextMenu = new Ext.menu.Menu({
          
    id'ListingEditorGridContextMenu',
          
    items: [
          { 
    text'Pay Bill'iconCls:'money'handlerpaidbillform },
          { 
    text'Add Bill'iconCls:'add'handleraddbillform },
          { 
    text'Delete Bill'iconCls:'remove'handlerdeleteContextMenu }
        
    //  ,'-',
        //  { text: 'Print this grid', iconCls:'printer', handler: printListingContextMenu }
          
    ]
       }); 
      
    grid.addListener('rowcontextmenu'onListingEditorGridContextMenu); 
    the commitChanges i did put in a var too:

    PHP Code:
    var commitChanges = function() {
            var 
    records store.getModifiedRecords();
            if(!
    records.length) {
                return;
            }
            var 
    data = [];
            
    Ext.each(records, function(ri) {
                var 
    r.getChanges();
                if(
    r.data.newRecord) {
                    
    o.newRecord true;
                }
                
    o[idName] = r.get('id');
                
    data.push(o);
            });
            var 
    = {
                 
    url:'php/modified.php'
                
    ,method:'post'
                
    ,callback:requestCallback
                
    ,params:{
                     
    cmd:'saveData'
                    
    ,objName:'bills'
                    
    ,data:Ext.encode(data)
                }
            };
            
    Ext.Ajax.request(o);
        } 
    // eo function commitChanges

        
    var requestCallback = function(optionssuccessresponse) {
            if(
    true !== success) {
                
    this.showError(response.responseText);
                return;
            }
            try {
                var 
    Ext.decode(response.responseText);
            }
            catch(
    e) {
                
    this.showError(response.responseText'Cannot decode JSON object');
                return;
            }
            if(
    true !== o.success) {
                
    this.showError(o.error || 'Unknown error');
                return;
            }

            switch(
    options.params.cmd) {
                case 
    'saveData':
                    var 
    records store.getModifiedRecords();
                    
    Ext.each(records, function(ri) {
                        if(
    o.insertIds && o.insertIds[i]) {
                            
    r.set('id'o.insertIds[i]);
                            
    delete(r.data.newRecord);
                        }
                    });
                    
    store.commitChanges();
                break;

                case 
    'deleteData':
                break;
            }
        } 
    // eo function requestCallback

        
    var showError = function(msgtitle) {
            
    Ext.Msg.show({
                 
    title:title || 'Error'
                
    ,msg:Ext.util.Format.ellipsis(msg2000)
                ,
    icon:Ext.Msg.ERROR
                
    ,buttons:Ext.Msg.OK
                
    ,minWidth:1200 String(msg).length 360 600
            
    });
        } 
    because this.idName and this.objName didn't/doesn't work with me i please it all with

    'id' and 'bills'


    this is my php file:
    [PHP]<?
    // vim: ts=4w=4:nu:fdc=4:nospell

    require("csql.php");

    if(!isset($_POST["cmd"])) {
    return;
    }

    $objects = array(
    // {{{
    // company
    "bills"=>array(
    "table"=>"bills"
    ,"idName"=>"id"
    ,"fields"=>array(
    "id"
    ,"name"
    ,"due"
    ,"amount"
    ,"paid"
    ,"paid_when"
    ,"amount_paid"
    ,"difference"

    )
    )
    // }}}
    );

    // create PDO object and execute command
    $osql = new csql();
    $_POST["cmd"]($osql);

    // command processors
    // {{{
    /**
    * getData: Outputs data to client
    *
    * @author Ing. Jozef Sak

  6. #96
    Ext User
    Join Date
    Mar 2008
    Posts
    60
    Vote Rating
    1
    joku is on a distinguished road

      0  

    Default


    I just played with the demo @ http://recordform.extjs.eu/ .
    It looks good!

    When I added a record via the regular add and then tried to delete it without entering any data into it, I couldn't delete it.

  7. #97
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,518
    Vote Rating
    376
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    Delete is not implemented, anyway it is not part of the plugin.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  8. #98
    Sencha User
    Join Date
    May 2007
    Location
    Germany
    Posts
    73
    Vote Rating
    1
    AlxH is on a distinguished road

      0  

    Default


    I had a small issue when destroying and recreating the recordform object.
    It took me hours to find out what is causing it. The following seems to fix it:
    Replace
    Code:
    var config = Ext.apply(this.defaultWindowConfig, this.windowConfig);
    With
    Code:
     var config={};
     Ext.apply(config,this.defaultWindowConfig);
     Ext.apply(config, this.windowConfig);
    in the show-function.

  9. #99
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,518
    Vote Rating
    376
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      0  

    Default


    What could be the reason? Any references to defaultWindow config that get overridden? Or you supply defaultWindowConfig? Or you re-use defaultWindowConfig?
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  10. #100
    Sencha User
    Join Date
    May 2007
    Location
    Germany
    Posts
    73
    Vote Rating
    1
    AlxH is on a distinguished road

      0  

    Default


    Quote Originally Posted by jsakalos View Post
    What could be the reason? Any references to defaultWindow config that get overridden? Or you supply defaultWindowConfig? Or you re-use defaultWindowConfig?
    Im not that deep into javascript. Could it be possible, that the defaultWindowConfig property is treated as class-property so that it is reused in the following instanciations? That would explain the strange behaviour, because you use an "applyIf" to assign the form item and listeners.
    The effect I observed, was that on the second instance in the listeners the form and window properties where null.

Thread Participants: 97

  1. franklt69 (1 Post)
  2. Wolfgang (1 Post)
  3. mystix (1 Post)
  4. cobnet (8 Posts)
  5. chiphi13 (4 Posts)
  6. mike1993 (1 Post)
  7. violinista (1 Post)
  8. hui2008 (4 Posts)
  9. AlxH (12 Posts)
  10. oracio (1 Post)
  11. CINUE (2 Posts)
  12. phpcoder (3 Posts)
  13. ostghost (2 Posts)
  14. tdikarim (4 Posts)
  15. lkasdorf (3 Posts)
  16. derf (1 Post)
  17. mjlecomte (11 Posts)
  18. farracha (1 Post)
  19. jcwatson11 (2 Posts)
  20. robin30 (8 Posts)
  21. bluesapphire (1 Post)
  22. wm003 (1 Post)
  23. divxer (1 Post)
  24. escalade (2 Posts)
  25. boonkerz (5 Posts)
  26. JamesC (2 Posts)
  27. neenhouse (5 Posts)
  28. mask_hot (18 Posts)
  29. concep86 (2 Posts)
  30. sinma (2 Posts)
  31. kai5263499 (2 Posts)
  32. jcmartinez (1 Post)
  33. trak (1 Post)
  34. amit.shukld (1 Post)
  35. hsurya (1 Post)
  36. richgoldmd (1 Post)
  37. loic (7 Posts)
  38. jimpa911 (1 Post)
  39. chalu (3 Posts)
  40. damian79 (1 Post)
  41. jimkan (6 Posts)
  42. jahong (7 Posts)
  43. winnel (1 Post)
  44. joku (1 Post)
  45. josephf (2 Posts)
  46. indrajit_bin_rahwana (4 Posts)
  47. nojutsu (2 Posts)
  48. pokerking400 (15 Posts)
  49. georgiosleon (2 Posts)
  50. snilson (2 Posts)
  51. nightowl (1 Post)
  52. gthe (1 Post)
  53. descheret (1 Post)
  54. nebbian (2 Posts)
  55. se7en.hu (1 Post)
  56. towanime (2 Posts)
  57. pravidya (4 Posts)
  58. cnagel (2 Posts)
  59. extnam01 (2 Posts)
  60. Rothariger (6 Posts)
  61. dsmaevich (1 Post)
  62. uidtest (2 Posts)
  63. savant (4 Posts)
  64. aserron (1 Post)
  65. skaue (1 Post)
  66. ielektronick (1 Post)
  67. kalpan (4 Posts)
  68. jasonb885 (2 Posts)
  69. wemerson.januario (1 Post)
  70. extjs_new (23 Posts)
  71. Dumas (24 Posts)
  72. m.natarajan (1 Post)
  73. MrEnirO (4 Posts)
  74. jove76 (2 Posts)
  75. CircleCode (3 Posts)
  76. mdimino (7 Posts)
  77. flinz (2 Posts)
  78. vince (2 Posts)
  79. jmaldini (5 Posts)
  80. mixer80 (1 Post)
  81. prox00 (1 Post)
  82. macdoug1 (14 Posts)
  83. return1.at (8 Posts)
  84. islabucasgrande (1 Post)
  85. big (1 Post)
  86. NicP (9 Posts)
  87. taron133 (1 Post)
  88. araiczyk (1 Post)
  89. adhoul (1 Post)
  90. mayurid (9 Posts)
  91. Kalpit (10 Posts)
  92. bizcatalyst (1 Post)
  93. Manuelbond007 (2 Posts)
  94. nasargus (1 Post)
  95. shahab_et (1 Post)
  96. stevwinata (5 Posts)
  97. tomdchi (2 Posts)
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..."