1. #31
    Ext JS Premium Member mcouillard's Avatar
    Join Date
    Jun 2008
    Location
    Bucks County, PA
    Posts
    102
    Vote Rating
    7
    mcouillard is on a distinguished road

      0  

    Thumbs up


    Fantastic extension! Works very well out of the box. I can't wait to see how this evolves.

  2. #32
    Sencha Premium Member
    Join Date
    May 2007
    Posts
    57
    Vote Rating
    0
    tchitani is on a distinguished road

      0  

    Default


    Hi

    I just curios to know why the command like:

    Ext.getCmp('ext-comp-1002').getStore().groupBy(['col_name1','col_name2'])

    does not work from command line for the example provided.

    Something is broken.

    Regards
    Nik

  3. #33
    Sencha User
    Join Date
    Nov 2007
    Posts
    20
    Vote Rating
    0
    ut_paule is on a distinguished road

      0  

    Smile


    Quote Originally Posted by DamienValentine View Post
    Hi all. I found that code completelly independent and very useful. I got it to work in my application even when I have to create grids in a windows builded by xml templates. But I am a little bit confused with grouping by date. I can't get it to work and in provided example there is the same problem - each date is a group even when dates are the same. How to fight that?
    p.s. sorry for my english . i am ukrainian.
    For some reason when doing the "not equal" check (!=) on the Date objects, it seems to fail, even if they are the same, as noted in the Firebug debug statements. The line in question is ...
    Code:
    if (lastvalues[j] != v) {
    I'm not sure why javascript fails on this (help anyone?) as i assumed it would default to doing a toString() on the objects and then compare them. Because it did not i have explicitly used the toString() if we are comparing objects. With this following change the ECD grouping worked.
    Code:
    if ( (typeof(v)=="object" && (lastvalues[j].toString() != v.toString()) ) || (typeof(v)!="object" && (lastvalues[j] != v) ) ) {
    I have a couple more tweaks I'm working on then I'll put out a new zip of the code. Meanwhile I'll attach the working screen shot...(I added sub-totaling in the groups for fun)

    Enjoy
    Attached Images

  4. #34
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    4
    mystix will become famous soon enough

      0  

    Default


    just a thought:
    are the time values (down to the milliseconds) on both Date objects the same?

    might need to run clearTime() on both if they're aren't.

  5. #35
    Ext User
    Join Date
    Apr 2008
    Posts
    18
    Vote Rating
    0
    DamienValentine is on a distinguished road

      0  

    Default


    the date is stored in mysql database and corresponding field has a type of 'date' not 'datetime'. so i am completely sure that the time values in any case are equal to something like 00:00:00.
    Code:
    if ( (typeof(v)=="object" && (lastvalues[j].toString() != v.toString()) ) || (typeof(v)!="object" && (lastvalues[j] != v) ) ) {
    Converting to string works perfect. Currently searching for formatting date in group caption:
    Code:
    groupTextTpl: '{text} : {gvalue} ({[values.rs.length]} {[values.rs.length == 1 ? "запис" : "записів"]})',
    to a Y-m-d format. If anyone knows the answer - please post your code.

  6. #36
    Sencha User
    Join Date
    Nov 2007
    Posts
    20
    Vote Rating
    0
    ut_paule is on a distinguished road

      0  

    Default When Equal Dates aren't Equal!

    When Equal Dates aren't Equal!


    Quote Originally Posted by mystix View Post
    just a thought:
    are the time values (down to the milliseconds) on both Date objects the same?

    might need to run clearTime() on both if they're aren't.
    If you look at the JSON they are being created from (orders.json)

    ecd: 'Aug 6, 2008',

    There should be no time on any of them. The JSON should get parsed consistently in all cases, and have the same time.

    I added the following debug
    Code:
    if(v instanceof Date)
      console.debug(lastvalues[j].format("Y-m-d\\TH:i:s.uuu"), v.format("Y-m-d\\TH:i:s.uuu"));
    And it gave this...
    Code:
    Row  2  added group. Values differ: prev= Wed Aug 06 2008 00:00:00 GMT-0700 (Pacific Daylight Time)  curr= Wed Aug 06 2008 00:00:00 GMT-0700 (Pacific Daylight Time)
    2008-08-06T00:00:00.000000000 2008-08-06T00:00:00.000000000
    So i'm ruling out a millisecond issue.

    If i perform the operation lastvalue[j]-v i get the answer 0 when they are the same which again is what i would expect for Date objects, so why == or != doesn't work is still a mystery to me

  7. #37
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    4
    mystix will become famous soon enough

      0  

    Default


    just fyi, the u format specifier is a single "u", not a sequence of "u"s.
    Code:
    someDate.format("Y-m-d\\TH:i:s.u")
    just tested, and standard js doesn't seem to allow Date comparisons using the == / === comparators.
    you're better off using something like
    Code:
    date1.getElapsed(date2) == 0;

  8. #38
    Sencha User
    Join Date
    Nov 2007
    Posts
    20
    Vote Rating
    0
    ut_paule is on a distinguished road

      0  

    Default


    Quote Originally Posted by tchitani View Post
    Hi

    I just curios to know why the command like:

    Ext.getCmp('ext-comp-1002').getStore().groupBy(['col_name1','col_name2'])

    does not work from command line for the example provided.

    Something is broken.

    Regards
    Nik
    Looking at the code, it looks like the groupBy() can be used to just add one field to the list of grouping fields, so i expect to do what you want you should try

    Ext.getCmp('ext-comp-1002').getStore().groupBy('col_name1');
    Ext.getCmp('ext-comp-1002').getStore().groupBy('col_name2');

    There is obviously room for improvement here. There is no simple method to set all the groups in one go, or to remove an individual group.

    The way to do this directly is to modify the store.groupField and then invoke the datachanged event. Look at the following code which is used when a group is dragged off the toolbar and removed.

    Code:
    // Remove this group from the groupField array
    var temp=[];
    for(var i=this.panel.store.groupField.length-1;i>=0;i--) {
      if(this.panel.store.groupField[i]==fld) {
        this.panel.store.groupField.pop();
        break;
      }
      temp.push(this.panel.store.groupField[i]);
      this.panel.store.groupField.pop();
    }
    
    for(var i=temp.length-1;i>=0;i--) {
      this.panel.store.groupField.push(temp[i]);
    }
    
    if(this.panel.store.groupField.length==0)
      this.panel.store.groupField=false;
    
    this.panel.store.fireEvent('datachanged', this);
    I will try and add these convenience methods in the near future.

    PaulE

  9. #39
    Ext User
    Join Date
    Apr 2008
    Posts
    18
    Vote Rating
    0
    DamienValentine is on a distinguished road

      0  

    Default


    I have made a quick solution to the date formatting. Piece of my code:
    Code:
    if (v) {
    				if (i == 0) {
    					// First record always starts a new group
    					if (typeof(v)=="object") {
    						addGroup.push({idx:j,dataIndex:fieldName,header:fieldLabel,value:Ext.util.Format.date(v,'Y-m-d')});
    					} else {
    						addGroup.push({idx:j,dataIndex:fieldName,header:fieldLabel,value:v});
    					}
    					lastvalues[j] = v;
    					gvalue.push(v);
    					grpFieldNames.push(fieldName);
    					grpFieldLabels.push(fieldLabel + ': ' + v);
    					//gvalue.push(v);
    				} else {
    					if ((typeof(v)=="object" && (lastvalues[j].toString() != v.toString())) || (typeof(v)!="object" && (lastvalues[j] != v)) ) {
    						// This record is not in same group as previous one
    						console.debug("Row ",i," added group. Values differ: prev=",lastvalues[j]," curr=",v);
    						if (typeof(v)=="object") {
    							addGroup.push({idx:j,dataIndex:fieldName,header:fieldLabel,value:Ext.util.Format.date(v,'Y-m-d')});
    						} else {
    							addGroup.push({idx:j,dataIndex:fieldName,header:fieldLabel,value:v});
    						}
    						lastvalues[j] = v;
    						//differ = 1;
    						changed = 1;
    						gvalue.push(v);
    						grpFieldNames.push(fieldName);
    						grpFieldLabels.push(fieldLabel + ': ' + v);
    				} else {
    					if (gfLen-1 == j && changed != 1) {
    						// This row is in all the same groups to the previous group
    						curGroup.rs.push(r);
    						console.debug("Row ",i," added to current group ",glbl);
    					} else if (changed == 1) {
    						// This group has changed because an earlier group changed.
    						if (typeof(v)=="object") {
    							addGroup.push({idx:j,dataIndex:fieldName,header:fieldLabel,value:Ext.util.Format.date(v,'Y-m-d')});
    						} else {
    							addGroup.push({idx:j,dataIndex:fieldName,header:fieldLabel,value:v});
    						}
    						console.debug("Row ",i," added group. Higher level group change");
    						gvalue.push(v);
    						grpFieldNames.push(fieldName);
    						grpFieldLabels.push(fieldLabel + ': ' + v);
    					} else if(j<gfLen-1) {
    						// This is a parent group, and this record is part of this parent so add it
    						if(currGroups[fieldName])
    							currGroups[fieldName].rs.push(r);
    						else
    							console.error("Missing on row ",i," current group for ",fieldName);
    						}
    					}
    				}
    			} else { 
    				if (this.displayEmptyFields) {
    					addGroup.push({idx:j,dataIndex:fieldName,header:fieldLabel,value:this.emptyGroupText||'(none)'});
    					grpFieldNames.push(fieldName);
    					grpFieldLabels.push(fieldLabel + ': ');
    				}
    			}
    I wonder if anyone can make a more elegant solution with appropriate settings in configuration or something like this. Thanks for sharing, ut_paule!

  10. #40
    Sencha User galdaka's Avatar
    Join Date
    Mar 2007
    Location
    Spain
    Posts
    1,166
    Vote Rating
    -1
    galdaka is an unknown quantity at this point

      0  

    Default


    Hi,


    Please attach your modifications in a file for upload to my site and all the people can test.

    Lastest example: http://www.jadacosta.es/extjs/exampl...ultiGroup.html


    Thanks in advance,

Thread Participants: 115

  1. galdaka (34 Posts)
  2. karimchebani (1 Post)
  3. mdissel (2 Posts)
  4. mystix (3 Posts)
  5. wayne_o (8 Posts)
  6. akannu (1 Post)
  7. tchitani (8 Posts)
  8. timmy (1 Post)
  9. dhenning23 (1 Post)
  10. DServe (1 Post)
  11. tdikarim (4 Posts)
  12. Nam (1 Post)
  13. ljkmchale (8 Posts)
  14. StaticVoidMain (2 Posts)
  15. sawan (1 Post)
  16. vicirst (1 Post)
  17. jaquet (1 Post)
  18. jerrybrown5 (4 Posts)
  19. ut_paule (10 Posts)
  20. nnextjs (1 Post)
  21. sergeiw (1 Post)
  22. st_gross (1 Post)
  23. emily (5 Posts)
  24. ENEMYoftheSUN (1 Post)
  25. smarttdv (1 Post)
  26. JDevloper (1 Post)
  27. Maharshi (2 Posts)
  28. pbuyle (2 Posts)
  29. cujo13 (2 Posts)
  30. johnstontrav (1 Post)
  31. Jack_S (8 Posts)
  32. DamienValentine (7 Posts)
  33. source78 (1 Post)
  34. cgs1999 (1 Post)
  35. Karmaresh (5 Posts)
  36. praveen.infra (2 Posts)
  37. pops (1 Post)
  38. mcouillard (2 Posts)
  39. maquejp (2 Posts)
  40. bvutukur (3 Posts)
  41. sim (2 Posts)
  42. tBSTAR (4 Posts)
  43. randymay (5 Posts)
  44. Rothariger (1 Post)
  45. shankys_4u (3 Posts)
  46. hpandey (1 Post)
  47. miha (3 Posts)
  48. wp.joju (4 Posts)
  49. oliverseitz (1 Post)
  50. tklever (1 Post)
  51. codingvista (3 Posts)
  52. iamdman (2 Posts)
  53. rene.klatt (1 Post)
  54. yrobla (1 Post)
  55. dmichael (1 Post)
  56. Helton Gon (1 Post)
  57. giovanni (2 Posts)
  58. nacha (1 Post)
  59. Tewr (2 Posts)
  60. snowy8781 (1 Post)
  61. rpnoble (1 Post)
  62. denyall (2 Posts)
  63. vladcd (3 Posts)
  64. rickonodera (1 Post)
  65. yyogev (21 Posts)
  66. daltonjorge (6 Posts)
  67. janasri (1 Post)
  68. dbojdo (1 Post)
  69. Azadi (1 Post)
  70. isit.gd (4 Posts)
  71. blackghost (3 Posts)
  72. dileep singhal (8 Posts)
  73. mrbeig9 (2 Posts)
  74. rupidas (1 Post)
  75. xiaofei (1 Post)
  76. extjsnewb (3 Posts)
  77. nestore2k (1 Post)
  78. TonyBones (2 Posts)
  79. Haron (1 Post)
  80. thorben (1 Post)
  81. amsoft (1 Post)
  82. paivajose (1 Post)
  83. Karthikeyan.rajmohan (1 Post)
  84. alexpotemkin (1 Post)
  85. cristinadelosa (1 Post)
  86. justusvm (4 Posts)
  87. Kunha (1 Post)
  88. rogerio.carrasqueira (1 Post)
  89. krishnaswamy (2 Posts)
  90. jdamani (1 Post)
  91. chavocarlos (2 Posts)
  92. raghuramgreddy (1 Post)
  93. garrythebest (1 Post)
  94. Komal Vaswani (1 Post)
  95. Hari1611 (3 Posts)
  96. sri_dev (1 Post)
  97. Ferny (1 Post)
  98. mosull2 (1 Post)
  99. Manjula (1 Post)
  100. roman.savko (2 Posts)
  101. grace.lawrence (3 Posts)
  102. leolox69 (5 Posts)
  103. fvchapa (1 Post)
  104. ilmcon (1 Post)
  105. pardhu (1 Post)
  106. psianil9 (1 Post)
  107. Golden.Vulture (1 Post)
  108. tempvalue (1 Post)
  109. Vishnu C (1 Post)
  110. shrujan07 (2 Posts)
  111. raffyaslanbeily (1 Post)
  112. srautpyaa (1 Post)
  113. ocr (1 Post)
  114. henriquebotega (1 Post)
  115. rajkumargvrs (2 Posts)

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar