Telerik Forums
Kendo UI for jQuery Forum
1 answer
90 views
01.<div data-bind="kendoGrid: {
02.    data: $root.Reports,
03.    groupable: true,
04.    scrollable: true,
05.    filterable: true,
06.    sortable: true,
07.    pageable: {
08.        pageSize: 10,
09.        pageSizes: true
10.    },
11.    columns: [
12.                    { field: 'ReportNumber', title : 'Report Number'},
13.                    { field: 'CreateDate', type:'date', template: function(dataItem) { return '<span>' + ConvertDate(dataItem.CreateDate, 'MM/DD/YYYY') + '</span>';}, title: 'Create Date'}
14.                    { command: { text: 'View', click: $root.ShowReport }, title:' ', width: 80}
15.    ]
16.    }">
17.</div>


01.function  ConvertDate(value, format) {
02.            var valueUnwrapped = ko.utils.unwrapObservable(value);
03.            var pattern = format || 'mmmm d, yyyy';
04.            if (valueUnwrapped == undefined || valueUnwrapped == null) {
05.                return '';
06.            } else {
07.                var date = moment(valueUnwrapped);
08.                var str = moment(date).format(pattern);
09.                return str;
10.            }
11.        }
Hi,

I am using knockout-kendo.js 

In the underlying data source for the grid the "CreateDate" is just a string like this: /Date(1368388119000)/
I have been able to display the date in the grid using the template as shown in the code above. But when I try to use the filter on the Create Date field it throws a javascript error  : Uncaught TypeError: Object /Date(1368388119000)/ has no method 'getTime'

What is the proper way to bind the date in this format so that the filtering works with it?

Jayesh Goyani
Top achievements
Rank 2
 answered on 18 May 2013
1 answer
214 views
Hi,

When a user is scrolling through many items in a grid that we have set up to use virtualization, I need to know when the grid is going back and requesting data because I have a few searching, sorting and filtering controls around the grid that I would like to also be disabled also when the grid pulls down more data.  Unfortunately, the requestStart and requestEnd events are not fired on the DataSource when this occurs.

Is there a possible workaround for this and/or could this be submitted as a bug please because I think it should fire these events when scrolling a virtualized grid.
Dimiter Madjarov
Telerik team
 answered on 18 May 2013
1 answer
341 views
I have a Grid defined as:
$("#FloorPlanGrid").kendoGrid({
        dataSource: floorPlanSource,
        toolbar: ['create'],
        columns: [
            {field: 'CompanyName', title: 'Company Name', editor: flooringDropDown},
            {field: 'AccountNumber', title: 'Account Number'},
            {field: 'CompanySubType', title: 'Sub Type'},
            {field: 'Active', title: 'Active'},
            {field: 'CreditAvailable', title: 'Credit Available'},
            {field: 'DFINumber', title: 'DFI Number'},
            {field: 'ClosedDate', title: 'Closed Date'},
            { command: ['edit', 'destroy'] }
        ],
        editable: 'inline',
        //edit: function (e) {
        //  debugger;
        //}
    });
With a custom editor for the company name defined as:
function flooringDropDown(container, options) {
    $("<input required data-text-field='Text' data-value-field='Value' data-bind='value: " + options.field + "'/>")
        .appendTo(container)
        .kendoDropDownList({
            autoBind: false,
            dataSource: {
                transport: {
                    read: window.PaymentOutsideOptionsUrl
                }
            },
            select: function(e) {
                var item = this.dataItem(e.item.index());
                 
                if (item) {
                    console.log(item.SubType);
                    debugger;
                }
            }
        }
    );
}
Where the debugger line is in the select event, I would like to set the value of the CompanySubType to item.SubType. I have verified that I can get the SubType, but I cannot for the life of me figure out how to set the value of the CompanySubType column. Could someone demonstrate how to set this value?

Jason
Dimiter Madjarov
Telerik team
 answered on 18 May 2013
5 answers
165 views
Hi,

How do I access the properties of the stock chart's navigator? I can access the chart's options like so:                    

var chart =  $("#stock-chart").data("kendoStockChart");
var chartOptions = chart.options;

but I am not having any luck with the navigator. I would like to add series and access other properties programmatically.

Thanks,
Tonih
T. Tsonev
Telerik team
 answered on 18 May 2013
1 answer
2.2K+ views
I'm evaluating the Kendo UI grid for possible use in a rails applications. Is there any way to customize the validation error messages for a column?

The validation seems to be working, but I still get the standard error messages:

schema: {
                        model: {
                            id: "id",
                            fields: {
                                name: { editable: true, validation: {required: true, message: "Brand name is required."}},
                                brand_code: {
                                    editable: true,
                                    validation: {pattern: "^[A-Z]{4}$", message: "Brand Code must be 4 upper case characters."}
                                },
                                brand_type: {editable: true, validation: { required: true }}
                            }
                        },
                        errors: "error"
                    }
Dimiter Madjarov
Telerik team
 answered on 18 May 2013
1 answer
336 views
I have a Kendo Grid with Inline Editing and the following for example:

.Editable(editable => editable.Mode(GridEditMode.InLine))

columns.Template(@<text></text>).ClientTemplate("<input type='checkbox' #= ActionAssign ? checked='checked':'' # class='chkbx5' />").Title("Assign").Width(100);

How can I only show the template checkbox only when in edit mode but when now like True/False etc. as a label or something.  If that is too difficult then just disabling the checkbox.  I am having a hard time finding some basic functionality type examples online.

Thanks
Sean
Dimiter Madjarov
Telerik team
 answered on 18 May 2013
1 answer
33 views
print options for Pop up windown
Vladimir Iliev
Telerik team
 answered on 18 May 2013
1 answer
209 views
Do kendo charts have linear-interpolation or anything similar? Any examples if present?
Iliana Dyankova
Telerik team
 answered on 18 May 2013
1 answer
134 views
I have a mobile tabstrip which has 5 tabs.  All the tabs except one will show a different view.  The last tab (more), I would like to show a custom slide up menu.  To get this to work, I tied to bind a data-click event to that one tab, which does not work.  I tried binding the even in my scripts, that did not work.  I tried the data-select event, but that even only fires once for the same tab, so I can't use that event since I can't hit the same tab again to hide my menu.  I am also using MVVM.  Is there anyway to bind an event to a single tab.  

Thanks,
Joe
Petyo
Telerik team
 answered on 18 May 2013
3 answers
67 views
Hi there,

I have an unusual use case where we have two tables (Table A and Table B) sharing a single datasource. Both tables has different number of columns which can be editable, e.g. Table A has columns 1-5 editable, while Table B only has column 2 being editable.

Form my understanding, whether a column is editable or not is controlled via the datasource's model. Is there any undocumented configurations where we could define the editable columns when we are defining the Grid? If not, will you be considering it for future updates?

Currently, my workaround is to define a custom editor for these columns, where my editor essentially blocks editing.

Thank you!
Nikolay Rusev
Telerik team
 answered on 17 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?