Show cool things you have done with our products


Post by gopi »

Hi
I am working on Advance Gantt chart with ASP.NET & SQL Server, and stuck up at the following issues, would you please help me

1. I have to show the dates in UK format, so I have changed the code in DemoGanttPanel.js. The date is displayed in UK Format, but the calculations are not working. (The days count is not updating, and sometimes counting holidays also)
 // Define the static columns
            columns: [
             new Gnt.column.WBS({ width: 70 }),      
                {
                    xtype : 'treecolumn',
                    header: 'Tasks',
                    sortable: true,
                    dataIndex: 'Name',
                    width: 200,
                    field: {
                        allowBlank: false
                    },
                    renderer : function(v, meta, r) {
                        if (!r.data.leaf) meta.tdCls = 'sch-gantt-parent-cell';

                        return v;
                    }
                },
                  {
                      xtype: 'gridcolumn',
                    header: 'Task Number',
                    sortable: true,
                    dataIndex: 'task_number',                      
                     field: {
                        allowBlank: true
                    }
                  },
               {
                    xtype: 'startdatecolumn',
                    renderer: Ext.util.Format.dateRenderer('d-m-Y'),
                    editor: new Ext.form.DateField({
                        format: 'd-m-Y'
                    })
                },
                {
                    //hidden : true,
                    xtype: 'enddatecolumn',
                    renderer: Ext.util.Format.dateRenderer('d-m-Y'),
                    editor: new Ext.form.DateField({
                        format: 'd-m-Y'
                    })
                },
2. I want to use 8 hours format for a day, not 24 hours. In the given example, if i give 8 hours, then it takes as "0.33 days". I have tried changing 24 hours to 8 hours in calender.js and gnt-all-debug.js, but no luck.
for example: if i give 8 hours, it should say 1 day, similarly 14 hours 1.5 days, 24 hours 3 days. Or either it should not allow me to take more than 8 hours.

Thanks
Gopi Krishna

Post by mats »

Hi Gopi,

Please use one thread per question.

1. No idea what you mean, the date display format doesn't have anything to do with the date. Please provide a clear test case with your expectations.

2. Please see our Calendars example in the /examples folder, it should show exactly what you need :)

Post by gopi »

Thanks Mats for your quick reply, I will do use one thread per question, here is my clear scenario for my first question.
I want to display the start date and end date in UK format, for which i have changed the code in DemoGanttPanel.js(code pasted in my earlier thread also).

After using this code, when i modify/change End date, then
a. the duration of the task is not updating at all, but end date is changing.
b. the duration of parent task is not updating properly. It is taking holidays also into count.
// Original Code in DemoGanttPanel.Js is
                 {
                    xtype: 'startdatecolumn'
                },
                {                 
                    xtype: 'enddatecolumn' },
// Original Code endhere

///Modified code in DemoGanttPanel.Js is
 {
                    xtype: 'startdatecolumn',
                    renderer: Ext.util.Format.dateRenderer('d-m-Y'),
                    editor: new Ext.form.DateField({
                        format: 'd-m-Y'
                    })
                },
                {
                    //hidden : true,
                    xtype: 'enddatecolumn',
                    renderer: Ext.util.Format.dateRenderer('d-m-Y'),
                    editor: new Ext.form.DateField({
                        format: 'd-m-Y'
                    })
                },
//Modified code ends here

I have been through https://docs.sencha.com/extjs/4.1.3/#!/api/Ext.Date, and tried other formats also. Do I need to change at any other central place, by which it automatically get displayed and do proper calculations, even for other hidden date columns?

This is the sample "EndDate" data for one of the child task record {28/08/2013 00:00:00}, coming from SQL Server.

Please let me know, if you require any other information. or I am not clear.

Thanks
Gopi Krishna

Post by mats »

When you post code, please use CODE tags.

If you're in need of localization you should look at our localization guide, which means you should include another Ext JS file to get the right formats of dates/money etc. You also need to localize our files and we have a guide showing how this is done, you can find it here:

https://www.bryntum.com/products/gantt-for-extjs/docs/ ... calization

Post by gopi »

Thanks Mats, I will look into that and get back to you, if required.

And will use code tags from next time onwards

Thanks
GK

Post Reply