1. #31
    Ext User jerrybrown5's Avatar
    Join Date
    Sep 2007
    Location
    Port St Lucie, FL
    Posts
    185
    Vote Rating
    0
    jerrybrown5 is on a distinguished road

      0  

    Default


    Saki,
    Don't worry about it...people call me Jeff all the time.

    I think you have made a lot of progress on the latest revision with a special note to the grouping handler. I like how you decided to override the expansion click event. It is cleaner than the way I chose. However, your version still does not have everything that I need.

    Three missing items that I view as critical that my "advanced" version has:

    *Individual action handlers. I don't want to code an if statement for each action. It does not follow the principals of structured programming.

    * On the click handler you are passing back the iconCls class name instead of the action object that created the action. Again, this does not follow the principals of structured programming.

    *getInline function on an action so that anyone can place an action anywhere inside a column cell value or grid header. Among many other things, this will allow a send email button next to an email address.

    If you can add these items than your tool will meet my requirements. If not then I will continue to support/develop my "advanced" version, which is not my desire but just something that I will need to do since I can not do without this functionality.


    Best regards,
    Jerry Brown

  2. #32
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    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


    Quote Originally Posted by jerrybrown5 View Post

    *Individual action handlers. I don't want to code an if statement for each action. It does not follow the principals of structured programming.
    What would be possible here would be an optional callback config option. That would still keep the thing lightweight. IMO, switch statement gives the handler the necessary structure. I wouldn't expect that there will be more 10 cases in majority of applications. Linux kernel sources use switches for up to 20-100 cases and kernel works fine.
    * On the click handler you are passing back the iconCls class name instead of the action object that created the action. Again, this does not follow the principals of structured programming.
    I'll wouldn't go for an "action object"; it's just too much for this simple thing. As far as I can see it wouldn't provide any advantages as the only duty of such object would be to provide a configuration and listener or callback function. I'd use objects for more complex tasks.
    *getInline function on an action so that anyone can place an action anywhere inside a column cell value or grid header. Among many other things, this will allow a send email button next to an email address.
    This calls for another extension "CellAction" as I've discussed with Frank a couple of posts back. One of my design principles was to create RowActions that would operate on grid row. CellAction requires different approach - if I'll have time I'll take a look at it.
    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


  3. #33
    Ext User jerrybrown5's Avatar
    Join Date
    Sep 2007
    Location
    Port St Lucie, FL
    Posts
    185
    Vote Rating
    0
    jerrybrown5 is on a distinguished road

      0  

    Default


    Saki,
    I put in my responses. I think a good technical debate is proper and required to get out the best way of doing things, especially on something as important as grid buttons--which will be used in hundreds if not thousands of applications.

    Quote Originally Posted by jsakalos View Post
    That would still keep the thing lightweight. ... I wouldn't expect that there will be more 10 cases in majority of applications....I'll wouldn't go for an "action object"; it's just too much for this simple thing.
    As you mentioned yourself since there won't be more than 10 actions ever on a grid, having each action as a separate object will not add much weight to the utility. It is like comparing the size of two files one being 3.1K and the other being 3.0K. True one is slightly larger but in reality it is negligible.


    Quote Originally Posted by jsakalos View Post
    As far as I can see it wouldn't provide any advantages as the only duty of such object would be to provide a configuration and listener or callback function. ...
    On obvious advantage that I'm not sure that you are seeing is that you could have global generic actions..eg delete a row, add a row, delete all items in a section, add item to a section,... . Action objects allow you to have fully encapsulated code from the presentation to the handling. I do not think we should discount this need.


    Quote Originally Posted by jsakalos View Post
    This calls for another extension "CellAction" as I've discussed with Frank a couple of posts back. One of my design principles was to create RowActions that would operate on grid row. CellAction requires different approach - if I'll have time I'll take a look at it.
    I am glad that you agree with the need; however, you are now proposing three separate modules (RowActions, RowAction and now CellAction) that all have the same general purpose and which could be handled effectively by a single plugin. IMHO, I think you might be adding to the compexity rather than taking away from it.

    I look forward to your response.
    Best regards,
    Jerry Brown

  4. #34
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    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


    Very briefly Jerry, I must produce much and discuss little:

    Lightweight means also maintainability, easy configuration, etc.

    Global generic action can be an universal callback function. Doesn't need to be an instantiated class.

    RowAction is not needed anymore, it is there only for backward compatibility for users who already used it. RowActions for RowActions, CellActions for CellActions used independently: one, another, or both depending on app.

    So, are you interested in callbacks? Do you, or somebody else, want them? I don't so I'll implement them only if there is an interest.
    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. #35
    Ext User jerrybrown5's Avatar
    Join Date
    Sep 2007
    Location
    Port St Lucie, FL
    Posts
    185
    Vote Rating
    0
    jerrybrown5 is on a distinguished road

      0  

    Default


    Saki,
    IMO a technical debate is always preferable since 90% of programming is thought and only 10% for the keyboard. Also, thanks for asking but I'm not that interested in a call back function which is too Win32API for me. Plus it adds redundant event handling which muddles code.

    Thanks for the clarification on RowAction. I assumed it was long term because it was still included on the download for RowActions. Two plugins (CellActions and RowActions) on the same grid would still cause multiple listeners on the click event which of course would increase the weight of the solution. Also, how are you going to determine where to place the click button inside the cell on the as of yet undeveloped CellActions module if you are not going to expose the inline function for an action. You would have to either put the action button in the back, the front, or would require the user to handcod a complex regex to place it. None of which I feel will be as clean as just grabbing the inline button code and then putting it whereever you want.

    I defintely think the Ext community should move closer to real Global Level Actions. If done right they could be used in toolbars, menus and of course grid row actions, with little to no regard to where they are placed. More on this. I think a lot of attention has placed on creating wonderful controls but not enough attention has been placed on how to organize the business code that acts on these controls.

    Best regards,
    Jerry Brown

  6. #36
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    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


    I just cannot withstand the idea that I have an unimplemented concept...

    So I've implemented configurable callbacks and updated the demo page to show them.
    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


  7. #37
    Ext User jerrybrown5's Avatar
    Join Date
    Sep 2007
    Location
    Port St Lucie, FL
    Posts
    185
    Vote Rating
    0
    jerrybrown5 is on a distinguished road

      0  

    Thumbs up


    I agree with you. It is too much fun making new features to let something go undone.

  8. #38
    Sencha User
    Join Date
    Mar 2007
    Posts
    763
    Vote Rating
    1
    franklt69 is on a distinguished road

      0  

    Default


    Saki some doubts about RowAction and RowActions

    I was using RowAction in this way:
    Code:
      this.actionStatus = new  Ext.ux.grid.RowAction();
        //override
        this.actionStatus.getIconCls = function(record, row, col) {
           if (record){
              switch(record.data.Status) {
    
                 case 'Approved': this.qtip = "Approved";
                                  return 'approved';
                                  break;
                 case 'Billed':    this.qtip = "Billed";
                                   return 'billed'
                                   break;
                  case 'Pending':  this.qtip = "Pending";
                                   return 'pending'
                                   break;
                  case 'Posted':    this.qtip = "Posted";
                                    return 'posted'
                                    break;
    
            }
            return 'icon-employeeCenter' ;
          }
        };
    this.actionStatus.on('action', function(grid, record) {
             alert('Status');
        });
    If I understand well, RowActions have more features that RowAction, but I was trying to migrate the code from RowAction to RowActions and don't work, so don't have compatibility
    I don't watch the method getIconCls, so are (RowAction and RowActions) differents extensions or in theory RowActions will be the same features of RowAction more others?

    now about cellAction you wrote:

    What you can test with current RowActions is to install an action event handler that would take data from other fields and it would, for example, started mail client. action event handler receives record as one of the arguments so it should be easy.
    could you give more detail because don't understand when wrote: is to install an action event handler

    regards
    Frank

  9. #39
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    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


    Frank,
    if you don't have separate fields for statusIcon and statusTooltip in your store you can override getData method and setup RowActions as follows:
    PHP Code:
    new Ext.ux.RowActions({
        
    actions:[{
             
    iconIndex:'statusIcon'
            
    ,qtipIndex:'statusQtip'
        
    }]
        ,
    getData:function(valuecellrecord) {
            var 
    status record.get('Status');
            return {
                 
    statusIcon:status status.toLowerCase() : 'icon-employeeCenter'
                
    ,statusQtipstatus status ''
            
    }
        }
    }); 
    It's written off-hand, I haven't tested it.
    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. #40
    Sencha User
    Join Date
    Mar 2007
    Posts
    763
    Vote Rating
    1
    franklt69 is on a distinguished road

      0  

    Default


    Saki using RowAction with this code the icon in grid appear ok

    Code:
      this.actionStatus = new  Ext.ux.grid.RowAction();
        //override
        this.actionStatus.getIconCls = function(record, row, col) {
           if (record){
              switch(record.data.Status) {
    
                 case 'Approved': this.qtip = "Approved";
                                  return 'approved';
                                  break;
                 case 'Billed':    this.qtip = "Billed";
                                   return 'billed'
                                   break;
                  case 'Pending':  this.qtip = "Pending";
                                   return 'pending'
                                   break;
                  case 'Posted':    this.qtip = "Posted";
                                    return 'posted'
                                    break;
    
            }
            return 'icon-employeeCenter' ;
          }
        };
    
    
     this.sheetType = new  Ext.ux.grid.RowAction();
        this.sheetType.getIconCls = function(record, row, col) {
    
            if (record){
              //si tiene units, tiene unitprice y hours es 0 debe ser un expense sino tiene q ser un timesheet
              if (record.data.ExpenseSheet_Units > 0 && record.data.ExpenseSheet_UnitPrice > 0 && record.data.TimeSheet_Hours == 0)
              {
                 this.qtip = "Expense";
                 return 'coins';
              }
              else
              {
                this.qtip = "Time";
                return 'clock';
              }
    
          }
        };

    Using RowActions with this code the icon in the grid appear Cut-out

    Code:
     //using RowActions
        this.actionStatus = new  Ext.ux.grid.RowActions({
                  actions:[{
    				iconIndex:'statusIcon'
                    ,qtipIndex:'statusQtip'
    			}],
            //override
            getData : function(value, cell, record) {
                   var status = record.data.Status;
                   //debugger;
                   return {
                     statusIcon:status ? status.toLowerCase() : 'icon-employeeCenter'
                     ,statusQtip: status ? status : ''
                      }
                   }
                });
    
    
    //using rowactions
        this.sheetType = new  Ext.ux.grid.RowActions({
            actions:[{
    				iconIndex:'statusIcon'
                    ,qtipIndex:'statusQtip'
    			}],
            //override
            getData : function(value, cell, record) {
    
              if (record){
              //si tiene units, tiene unitprice y hours es 0 debe ser un expense sino tiene q ser un timesheet
              if (record.data.ExpenseSheet_Units > 0 && record.data.ExpenseSheet_UnitPrice > 0 && record.data.TimeSheet_Hours == 0)
              {
                  return {
                     statusIcon:'coins'
                     ,statusQtip: "Expense"
                      }
              }
              else
              {
    
                  return {
                     statusIcon:'clock'
                     ,statusQtip: "Time"
                      }
              }
    
          }
    
                   }
        });
    watch attachment

    The same in FF2 and IE6

    regards
    Frank
    Attached Images

Thread Participants: 227

  1. franklt69 (10 Posts)
  2. Condor (3 Posts)
  3. Enrico (1 Post)
  4. Dumbledore (2 Posts)
  5. mystix (1 Post)
  6. riets003 (2 Posts)
  7. KRavEN (3 Posts)
  8. sfwalter (1 Post)
  9. Taurus (3 Posts)
  10. fshort (5 Posts)
  11. tchitani (2 Posts)
  12. temporary (1 Post)
  13. pantarhei (2 Posts)
  14. Specks (5 Posts)
  15. spotk (1 Post)
  16. cmendez21 (2 Posts)
  17. anjelika (3 Posts)
  18. askar (3 Posts)
  19. 6epcepk (1 Post)
  20. lkasdorf (1 Post)
  21. Gunmen (1 Post)
  22. mjlecomte (7 Posts)
  23. Nam (2 Posts)
  24. rekam (4 Posts)
  25. ZooKeeper (3 Posts)
  26. cking (1 Post)
  27. JEBriggs (1 Post)
  28. Yossi (9 Posts)
  29. border9 (2 Posts)
  30. justinfalk (1 Post)
  31. Spirit (6 Posts)
  32. gounis (1 Post)
  33. .andy (1 Post)
  34. robin30 (2 Posts)
  35. knt (2 Posts)
  36. Shmoo (2 Posts)
  37. Strati (1 Post)
  38. jerrybrown5 (12 Posts)
  39. KevinChristensen (1 Post)
  40. jon (2 Posts)
  41. BigTitus (2 Posts)
  42. elDub (4 Posts)
  43. fgerneth (2 Posts)
  44. elnove (2 Posts)
  45. vendiddy (1 Post)
  46. ray007 (6 Posts)
  47. dizelland (1 Post)
  48. donssmith (1 Post)
  49. horrikhalid (5 Posts)
  50. wasp (1 Post)
  51. cblin (1 Post)
  52. ncx5 (3 Posts)
  53. mask_hot (1 Post)
  54. teddyjas (2 Posts)
  55. Zolcsi (1 Post)
  56. PTG (5 Posts)
  57. yaroslav (2 Posts)
  58. Yoris (3 Posts)
  59. DhakouaniM (1 Post)
  60. lobo-tuerto (12 Posts)
  61. angelflaree (3 Posts)
  62. skhan (3 Posts)
  63. ibaniski (3 Posts)
  64. achebe (1 Post)
  65. svdb (1 Post)
  66. emily (6 Posts)
  67. jezmck (3 Posts)
  68. SAnDAnGE (1 Post)
  69. eliezerreis (4 Posts)
  70. nutflakes (2 Posts)
  71. RoDush (1 Post)
  72. tonig84 (2 Posts)
  73. kpmonroe (1 Post)
  74. KJedi (1 Post)
  75. javaeedeveloper (2 Posts)
  76. razvanioan (3 Posts)
  77. jla (2 Posts)
  78. max52 (1 Post)
  79. seppy (5 Posts)
  80. adz08 (1 Post)
  81. chalu (10 Posts)
  82. sekaijin (2 Posts)
  83. jimkan (1 Post)
  84. joao_candido (3 Posts)
  85. fanta2k (1 Post)
  86. nctag (3 Posts)
  87. yhwh (2 Posts)
  88. zmijanow (3 Posts)
  89. brizardh (3 Posts)
  90. zxyth (6 Posts)
  91. johnstontrav (2 Posts)
  92. dalad (2 Posts)
  93. niaz (4 Posts)
  94. armandoxxx (8 Posts)
  95. nojutsu (3 Posts)
  96. lfelican (2 Posts)
  97. DamienValentine (2 Posts)
  98. NoahK17 (10 Posts)
  99. shay2501 (2 Posts)
  100. sdileep (1 Post)
  101. pokerking400 (19 Posts)
  102. lacco (2 Posts)
  103. medley (8 Posts)
  104. archmisha (3 Posts)
  105. rizjoj (2 Posts)
  106. thephatp (2 Posts)
  107. descheret (1 Post)
  108. macedge (6 Posts)
  109. ttbgwt (2 Posts)
  110. allistar (3 Posts)
  111. emredagli (1 Post)
  112. Nadril (2 Posts)
  113. mbajema (1 Post)
  114. wwwtd (1 Post)
  115. Besessener (6 Posts)
  116. Chrissu (3 Posts)
  117. pavanextjs (6 Posts)
  118. javauser (2 Posts)
  119. AmitOlsys (7 Posts)
  120. afei (1 Post)
  121. kurtis (6 Posts)
  122. DamianHartin (2 Posts)
  123. kimmking (1 Post)
  124. jollyca (2 Posts)
  125. Rothariger (10 Posts)
  126. ThunderZtorm (3 Posts)
  127. Stephan Schrade (1 Post)
  128. groyk (2 Posts)
  129. bwhitehall (2 Posts)
  130. neteor (2 Posts)
  131. saipkjai (1 Post)
  132. randomuser01 (1 Post)
  133. kisjonnk (1 Post)
  134. divad (2 Posts)
  135. fxmisticat (2 Posts)
  136. dasnk (1 Post)
  137. klascano (1 Post)
  138. sarav (1 Post)
  139. ringfas (1 Post)
  140. iBeb (1 Post)
  141. kjleng (1 Post)
  142. resonante (4 Posts)
  143. wki01 (1 Post)
  144. quen567 (2 Posts)
  145. nightwatch (2 Posts)
  146. SunWuKung (2 Posts)
  147. nar (1 Post)
  148. mnc (1 Post)
  149. wgpubs (3 Posts)
  150. Stju (1 Post)
  151. d4rk knight (2 Posts)
  152. igor_vlad (1 Post)
  153. lassaad (1 Post)
  154. Dumas (5 Posts)
  155. s.m.srinivas (2 Posts)
  156. whodat (7 Posts)
  157. Kudzu (1 Post)
  158. nathanblogs (1 Post)
  159. leonardodaza (2 Posts)
  160. The Edge (1 Post)
  161. tahseen.ur.rehman (1 Post)
  162. Andrelmp (2 Posts)
  163. dfa (1 Post)
  164. cybersys (5 Posts)
  165. flylaputa (3 Posts)
  166. Tawez (2 Posts)
  167. Fred Seyffert (2 Posts)
  168. Jangla (7 Posts)
  169. agent29 (1 Post)
  170. vinaykurudi (1 Post)
  171. Jim.Barrows (2 Posts)
  172. PV-Patrick (1 Post)
  173. jakeext (2 Posts)
  174. quicksilver_in (12 Posts)
  175. dewoob (2 Posts)
  176. gelgoogho (1 Post)
  177. andyatmiami (1 Post)
  178. rat (1 Post)
  179. Margusja (6 Posts)
  180. charcalcado (1 Post)
  181. realjax (2 Posts)
  182. kartikayg (4 Posts)
  183. sanantone (1 Post)
  184. iryndin (2 Posts)
  185. Joel (2 Posts)
  186. jsemmanuel (2 Posts)
  187. jeffcirceo (1 Post)
  188. boldt (1 Post)
  189. schoonmoeder (2 Posts)
  190. kr1pton (2 Posts)
  191. 29er (1 Post)
  192. return1.at (1 Post)
  193. extjsnewb (1 Post)
  194. frrogoy (1 Post)
  195. hotdesc (2 Posts)
  196. a.bongardt (1 Post)
  197. King_Aero (1 Post)
  198. daiei27 (3 Posts)
  199. jasmina (3 Posts)
  200. winsent (1 Post)
  201. hsomesun (2 Posts)
  202. max.bertolini (1 Post)
  203. Dmoney (1 Post)
  204. maxazan (1 Post)
  205. cyChop (2 Posts)
  206. pipiet06 (2 Posts)
  207. asafm (2 Posts)
  208. adetogni (4 Posts)
  209. rebeccapeltz (10 Posts)
  210. enoal (3 Posts)
  211. rrpero (3 Posts)
  212. test45 (1 Post)
  213. kevDawg (3 Posts)
  214. anacab (1 Post)
  215. travin (1 Post)
  216. bidibule (1 Post)
  217. JimR (5 Posts)
  218. apurva_mistry (1 Post)
  219. pramodkhare (3 Posts)
  220. dm7777 (1 Post)
  221. extjs-dev (2 Posts)
  222. aveltens (1 Post)
  223. carlosgoias (1 Post)
  224. oeginc (2 Posts)
  225. schusco (3 Posts)
  226. katxeus (1 Post)
  227. ashetti (2 Posts)