Telerik Forums
Kendo UI for jQuery Forum
1 answer
901 views

Hi..

I'm customizing the boolean fields using template option in kendo column configuration and its working fine.but while doing export excel custom template is getting converted to boolean.

example  :  im having status column of type boolean/number,using template im displaying status as (Active/Inactive/pending).when i do export excel it is displaying as true/false in excel sheet.

Here is the example code with boolean type:

 kendoProperties.addColumnConfiguration({
                    type: "boolean", sortable: false, field: "isPublished", title: "Publish Status", filterable: false,
                    template: "<label class=\"action-status#=isPublished#\">#= (isPublished == false) ? 'NOT PUBLISHED' : 'PUBLISHED' #</label>", width: "150px"
                });

example code with number type:

Parser:

            function parseDataForKendo(result) {
                var data = [];
                productionScheduleListVm.scheduleList = result.results;
                var results = result.results;
                for (var i = 0; i < results.length; i++) {
                    var schedule = {
                        status: results[i].schedule ? results[i].schedule.status : 0,
                        scheduleStatusClass: results[i].schedule.status ? resolveScheduleStatusCssClass(results[i].schedule.status) : null,
                        scheduleStatusText: results[i].schedule.status ? resolveScheduleStatusText(results[i].schedule.status) : null,
                    };
                    data.push(schedule);
                }
                return { "results": data, "totalResults": result.totalResults };
            };

column config:

  kendoProperties.addColumnConfiguration({
                    type: "number", sortable: true, hideWhenMinimize: true, field: "status", title: "Status", filterable: { cell: { template: statusFilter, showOperators: false }},
                    template: "<label class=\"schedule#=scheduleStatusClass# scheduleLabel\">#= (status == null) ? '-NA-' : scheduleStatusText# </label>"
                });

 

Rosen
Telerik team
 answered on 01 Apr 2016
2 answers
415 views
I'm trying to get panning and zooming working with a multi-axis line chart.  I had the multi-axis line chart working with series data, but it's my understanding that I need to use a dataSource in order to get panning and zooming working.  I've got panning and zooming working with a single line series, but can't get it working with multi-axis.  No lines show in the chart.  The panning and zooming functionality does seem to be there though.

 

 

 

 

It seems that there might be multiple ways to do it, but I used the following example on jsbin for my configuration

http://jsbin.com/rudikuyuju/edit?html,js,output

Here is one object of the dataPoints.data array defined in dataSource

0:Object
A1C:0
AMAvg:170
Average30Days:142
Average60Days:140
Average90Days:144
CollectionDate:"/Date(1457931600000)/"
LunchAvg:162
PMAvg:190

Note that I don't use all the fields for this one chart.  I have another chart that is configured using the rest of the fields.  I don't know if that matters or not.  Also, I'm pretty sure that CollectionDate is ok....that's ASP.NET format and works on the chart with just one series.

 

Here's the typescript code:

 

 

 

let chartConfiguration: ChartConfiguration = {
    renderAs: "canvas",
    dataSource: {
        data: dataPoints.data,
        schema: {
            model: {
                CollectionDate: { type: 'date' },
                AMAvg: { type: 'number' },
                lunchAvg: { type: 'number' },
                PMAverage: { type: 'number' }
            }
        }
    },
    series: [
        {
            type: 'line',
            field: 'AMAvg',
            axes: 'glucose',
            categoryField: 'CollectionDate',
            markers: {
                visible: false
            }
        },
        {
            type: 'line',
            field: 'LunchAvg',
            axes: 'glucose',
            categoryField: 'CollectionDate',
            markers: {
                visible: false
            }
        },
        {
            type: 'line',
            field: 'PMAvg',
            axes: 'glucose',
            categoryField: 'CollectionDate',
            markers: {
                visible: false
            }
        },
 
    ],
    pannable: {
        lock: "y"
    },
    zoomable: {
        mousewheel: {
            lock: "y"
        },
        selection: {
            lock: "y"
        }
    },
    valueAxes : [{
        name: "glucose",
        title: { text: "glucose" },
        min: 50,
        max: 399
    }],
    seriesDefaults: {
        type: 'line',
        line: {
            line: {
                style: 'smooth'
            }
        }
    },
    tooltip: {
        visible: true,
        format: '{0}',
        template: '${value} '
    },
    categoryAxis: {
        type: "category",
        field: 'CollectionDate',
        baseUnit: 'days',
        baseUnitStep: 1,
        min: 0,
        max: 15,
        labels: {
            format: "{0:MM/dd/yy }",
            rotation: "auto"
        },
    }
};
Daniel
Telerik team
 answered on 01 Apr 2016
1 answer
231 views

We have a treeview that uses a template. The template is inline with the HTML for the page and is referred to with a JQuery id search. This is what is shown for the template demo for Kendo.

However this is incompatible with unit testing an angular controller containing options including the reference to the template in HTML which is not loaded in a controller test. Result is that unit tests blow up trying to reference the template with JQuery.

Now the angular demo does this in a way that should be compatible in that it embeds a <span> with a k-template with bound items from the controller, so the controller can be isolated for unit test.

However our template is dynamic in that it is a conditional template similar to # if (mybool) #  some html  #else# some other html. (you get the idea).

There appears to be no examples of how to do this type of dynamic template that would be compatible with an angular unit test, because this type of template is not HTML it is actually a script.

Before we redo the app, has anyone got an example? The only other solution we have thought of is to change the template string to a function and call a service that dynamically compiles a string, but we are not sure if this would be worth the effort (would work)... even though it would allow mocking the service to isolate the controller.

Dimo
Telerik team
 answered on 01 Apr 2016
2 answers
246 views

Hi,

When creating/editing an event in scheduler the two datetimepickers for start and end datetime default to en-UK formating.

I know how to change this if you have a datetimepicker ....

<input id="datetimepicker" />

<script>
    $("#datetimepicker").kendoDateTimePicker({
        culture: "de-DE"
    });
</script>

 

So I tried this in the schema section of the scheduler...

schema: {
   model: {
           id: "taskId",
                     fields: {
taskId: { from: "TaskID", type: "number" },
                            title: { from: "Title", validation: { required: true } },
                            start: { from: "Start", type: "date", culture: "en-GB" },
                            end: { from: "End", type: "date", culture: "en-GB" },
                            startTimezone: { from: "StartTimezone" },
                            endTimezone: { from: "EndTimezone" },
                            isAllDay: { from: "IsAllDay", type: "boolean", defaultValue: false },
                            isOOH: { from: "IsOOH", type: "boolean", defaultValue: false },
                            description: { from: "Description" },
                            recurrenceId: { from: "RecurrenceID" },
                            recurrenceRule: { from: "RecurrenceRule" },
                            recurrenceException: { from: "RecurrenceException" },
                            team: { from: "Team", validation: { required: true } },
                            assignee: { from: "Assignee", validation: { required: true } }
                           }
                    },

but it does not seem to work. I have added a reference to 

Vladimir Iliev
Telerik team
 answered on 01 Apr 2016
3 answers
771 views
If you open 2 non modal windows from modal window, and then close one non modal window, the second window gets z-index lover than k-overlay.
Demo.
Not expected behaviour.
Dimo
Telerik team
 answered on 01 Apr 2016
1 answer
483 views

Hi,

i have a problem with custom my editable popup.

The error is on k-editable, i can't use my template and the browser show me this error:

Error: [$parse:lexerr] Lexer Error: Unexpected next character at columns 50-50 [#] in expression [{ 'mode': 'popup', 'template': 'kendo.template($('#popup_editor').html())' }]. http://errors.angularjs.org/1.4.9/$parse/lexerr?p0=Unexpected%20next%20character%20&p1=s%2050-50%20%5B%23%5D&p2=%7B%20'mode'%3A%20'popup'%2C%20'template'%3A%20'kendo.template(%24('%23popup_editor').html())'%20%7D

 

 

This is the html code:

<div kendo-grid
         id="LineGrid"
         k-data-source="lineCtrl.linesList"
         k-editable="{ 'mode': 'popup', 'template': 'kendo.template($('#popup_editor').html())' }"
         k-selectable="'single'"
         k-on-save="lineCtrl.OnSaveEventHandler(kendoEvent)"
         k-toolbar="['create']"
        class="bm_grid">
    </div>

 

This is the template script:

<script type="text/x-kendo-template" id="popup_editor">
        <p>Custom editor template</p>
        <div class="k-edit-label">
            <label for="FirstName">First Name</label>
        </div>

</script>

 

How can i solve it?

Boyan Dimitrov
Telerik team
 answered on 01 Apr 2016
1 answer
538 views
As its shown below, i'm overriding my read function in transport to send ajax request to get data and set it as datasource for the grid but i also have server side paging enabled with virtual scrolling. But i have noticed that i see instead of one, multiple requests(at least two) were sent. I read the posts and people are talking about prefetch and fetch issue. Is there any good solution sofar to fix this issue in my case.
 
var dataSource = {
    transport: {
        read: function (options) {
            var success = function (response) {
                options.success(response);
            };
 
            var error = function (xhr, status, error) {
                Ember.Logger.error('Fail response: ' + xhr.responseText + ' (status=' + xhr.status + ' ' + error + ')');
            };
            _this.get('PopulateGridData')(gridUrl, success, error, options.data, 'POST', true, true);
        },
    },
    pageSize: gridPageSize,
    schema: gridSchema,
    serverPaging: true,
    serverSorting: true,
    serverGrouping: true,
    serverFiltering: true,
};
 
var gridOptions = {
    dataSource: dataSource,
    columns: gridColumns,
    editable: gridEditable,
    pageable: {
        refresh: true,
        numeric: false,
        previousNext: false,
    },
    height: gridHeight,
    scrollable: {
        virtual: true,
    },
    groupable: true,
    filterable: true,            
};
 
var grid = Ember.$("#kendo-grid").kendoGrid(gridOptions).data('kendoGrid');
 
_this.set('kendoGrid', grid);
Nikolay Rusev
Telerik team
 answered on 01 Apr 2016
1 answer
227 views

I'm looking at an example in your mvc demo where you use checkboxes to filter events in a scheduler. I wish to implement a similar function but need to use a dropdown (due to the number of options). The code for the checkbox scenario is...

$("#people :checkbox").change(function(e) {
        var checked = $.map($("#people :checked"), function(checkbox) {
                return parseInt($(checkbox).val());});
                
var scheduler = $("#scheduler").data("kendoScheduler");
                
scheduler.dataSource.filter({
                        operator: function(task) {
                                return $.inArray(task.ownerId, checked) >= 0;
                       
}
                });
         });

How do I achieve similar (my dropdown values are strings) using a dropdown?

Vladimir Iliev
Telerik team
 answered on 01 Apr 2016
3 answers
802 views

When updating to 2015.2.805, we've discovered a NUMBER of  problems with our usage of Angular and Kendo.  We regularly update, and have had no problems previously.  We're hoping we can get some answers as to the problem(s).

 

We use ng-ifs to hide/show tabs based on certain parameters.  In the latest release, this technique breaks the rendering of the tabstrip.

http://dojo.telerik.com/arEfI/2

 

Here's the previous release, where it works just fine. 

http://dojo.telerik.com/EDibu/2

​

What's wrong?​

Rob
Top achievements
Rank 1
 answered on 31 Mar 2016
1 answer
166 views

We updated our Kendo version and some change caused our text input to lose the clear button (x icon) to disappear.

 

Any idea how to get this back? I'm not sure if it is in the kendo or bootstrap css.

Marc
Top achievements
Rank 1
 answered on 31 Mar 2016
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?