This is a migrated thread and some comments may be shown as answers.

Grid - Problem grouping by date fields (bug??)

6 Answers 174 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 12 Jan 2012, 05:17 AM
Thanks to the Kendo staff for getting me on track with my date handling (separate thread post).   I have run across some odd behavior in the grid.  I am now properly showing data in the grid using Javascript Date objects, which allows for proper sorting / filtering.     What I have found is that while I can filter by a date properly, if I use grouping function on a date column, it breaks out each date as it's own group  (see attached files for a FILTER snap and a GROUP snap on the same data).   

I also duplicated the behavior in this sample fiddle that has been floating round the forums (run it, then drag OrderDate column header up to the grouping bar):
 
http://jsfiddle.net/divotfixer/TTRbm/

6 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 12 Jan 2012, 10:50 AM
Hello,

Indeed, I have observed the same behavior as you have described. However, we managed to address it and the fix will be available with the next internal build. Meanwhile, I have also updated your telerik points.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Andrés
Top achievements
Rank 1
answered on 19 Jan 2012, 01:49 AM
Hi Rosen
Also, grouping doesn't handle nulls and just crashes. Doesn't really apply to dates alone, strings have the same problem.
Sorting does work though.

Example based on the one above, group by the date to see the problem:
http://jsfiddle.net/aMHTs/1/

Is there a way around that?

Cheers
PS: I added a databound handler as well to prevent the grid from showing the text "null" in the cell, but the problem is the same with or without that.
0
Rosen
Telerik team
answered on 19 Jan 2012, 10:22 AM
Hello Andrés,

I have recreated the described issue and we have addressed it. This fix will be also available in the next internal build as well as in the next official release. Your telerik points has been updated.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Devloper
Top achievements
Rank 1
answered on 20 Aug 2013, 02:07 PM
Hello,

Is this fix in the current release?

Thanks,
Amin
0
Sebastian
Telerik team
answered on 20 Aug 2013, 02:45 PM
It should be, since it was addressed more than a year and a half ago, as my colleague Rosen stated, Amin.


Regards,
Sebastian
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
harisa
Top achievements
Rank 1
answered on 27 May 2014, 11:24 AM
date sorting issue..

<table id="grid">
                <thead>
                    <tr>
 <th>SNO</th>
                        <th data-field="NAME">NAME</th>
                        <th data-field="EMPID">EMPID</th>
                        <th data-field="CATEGORY">CATEGORY</th>  
                        <th data-field="SUBCATEGORY">SUBCATEGORY</th>  
                        <th data-field="CONTACTDURING">CONTACTDURING</th>  
                        <th data-field="DEPARTMENT">DEPARTMENT</th>  
                        <th data-field="SUBDEPARTMENT">SUBDEPARTMENT</th>  
                        <th data-field="STATUS">STATUS</th>  
                        <th data-field="datefrom">FROM DATE</th>
                        <th data-field="TODATE">TO DATE</th>
                        <th data-field="TOTALDAYS">TOTALDAYS</th>
                        <th data-field="DEATHCATEGORY">DEATHCATEGORY</th>                         
                    </tr>
                </thead>
                <tbody>
                   <?php
$i=1;

                       foreach($leaveInfo as $records){  
                           $newDate = date("d/M/y", strtotime( $records['FROMDATE']));
                           $newDate1 = date("d/M/y", strtotime( $records['TODATE']));
                           ?>                  
                           <tr>
                      <td></td>
                      <td><a href="<?php echo $this->baseUrl()?>/index/employeeprofile/id/<?php echo $records['EMPID']?>"><?php echo $records['NAME']?></a></td>                      <td><?php echo $records['EMPID']?></td>
                      <td><?php echo $records['CATEGORY']?></td>
                      <td><?php echo $records['SUBCATEGORY']?></td>
                      <td><?php echo $records['CONTACTDURING']?></td>
                      <td><?php echo $records['DEPARTMENT']?></td>
                      <td><?php echo $records['SUBDEPARTMENT']?></td>
                      <td><?php echo $records['STATUS']?></td>
                      <td><?php echo $newDate;?></td>
                      <td><?php echo $newDate1;?></td>
                      <td><?php echo $records['TOTALDAYS']?></td>
                      <td><?php echo $records['DEATHCATEGORY']?></td>
                           </tr>              
                   <?php }?>
                </tbody>
</table>
<?php }else{   echo "</br></br><div align='center'><h2>No Leave Record Found</h2></div>";
}?>
<script type="text/javascript">
 var record=0;
$("#grid").kendoGrid({
        schema: {
        model: {
            fields: {
SNO: { type: "number"},
                NAME: { type: "string"},
                EMPID: { type: "string"},  
                CATEGORY: { type: "string" },  
                SUBCATEGORY: { type: "string" },  
                CONTACTDURING: { type: "string" },  
                DEPARTMENT: { type: "string" },  
                SUBDEPARTMENT: { type: "string" },
                STATUS: { type: "string" },
                datefrom: { type: "date" },  
                TODATE: { type: "date" },  
                TOTALDAYS: { type: "string" },
                DEATHCATEGORY: { type: "string" }  
                  
                
            }
            
        }
    },
    groupable: true,
    navigatable: true,
    columnMenu: true,
    columns: [
     {
         title: "&nbsp;",
         template: "#= ++record #",
         width: 60
       
    },
 {
        field: "NAME",
        title: "NAME",
       
    },
 
    {
        field: "EMPID",
        title: "EMPID",
       
    },
    {
        field: "CATEGORY",
        title: "CATEGORY",
       
    },
    {
        field: "SUBCATEGORY",
        title: "SUBCATEGORY",
       
    },
    {
        field: "CONTACTDURING",
        title: "CONTACTDURING",
       
    },
    {
        field: "DEPARTMENT",
        title: "DEPARTMENT",
       
    },
    {
        field: "SUBDEPARTMENT",
        title: "SUBDEPARTMENT",
       
    },
    {
        
        field: "STATUS",
     title: "STATUS",
       
       
    },
    {
         field: "datefrom",
         title: "FROMDATE",
         template: '#= kendo.toString(kendo.parseDate(datefrom, "dd/MMM/yy"), "dd/MMM/yy") #'
         //format: "{0:dd/MMM/yy}"
           
        },  
    {
        
          field: "TODATE",
        title: "TODATE",
        template: '#= kendo.toString(kendo.parseDate(TODATE, "dd/MMM/yy"), "dd/MMM/yy") #'
        //format: "{0:yy}",
      },
      {
          field: "TOTALDAYS",
          title: "TOTALDAYS",
          
         
      },
     
    
    {
       
        field: "DEATHCATEGORY",
     title: "DEATHCATEGORY",
    }
],
 
    scrollable: true,
    navigatable: true,
    sortable: true,
    filterable: true,
    editable: "popup",
    
    dataBinding: function() {
        record = 0;
       
      }
   });

from date is not sorted properly..
kindly help me please//
Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Andrés
Top achievements
Rank 1
Devloper
Top achievements
Rank 1
Sebastian
Telerik team
harisa
Top achievements
Rank 1
Share this question
or