Telerik Forums
Kendo UI for jQuery Forum
5 answers
1.2K+ views
I an posting this fully functional code to help others with the issue. The code below sets the column titles with a dynamic variable that is set based on FunctionalBusinessArea.

@model SPI.UI.View.Models.RecordingDetails
@{
    //Dynamically set the grid column labels based on functional business area.
    var colProgram = string.Empty;
    var colTeritoryName = string.Empty;
    var colParty = string.Empty;
    var colCatalog = string.Empty;


    if (ViewBag.FunctionalBusinessArea == "Song")
    {
        colProgram = @WorkRes.GridWCIColProgram;
        colTeritoryName = @WorkRes.GridWCIColTerritory;
        colParty = @WorkRes.GridWCIColParty;
        colCatalog = @WorkRes.GridWCIColCatalog;
    }
    else if (ViewBag.FunctionalBusinessArea == "Product")
    {
        colProgram = @ProductRes.GridWCIColProgram;
        colTeritoryName = @ProductRes.GridWCIColTeritory;
        colParty = @ProductRes.GridWCIColParty;
        colCatalog = @ProductRes.GridWCIColImprint;
    }
    else if (ViewBag.FunctionalBusinessArea == "Recording")
    {
        colProgram = @RecordingRes.GridWCIColProgram;
        colTeritoryName = @RecordingRes.GridWCIColTeritory;
        colParty = @RecordingRes.GridWCIColParty;
        colCatalog = @RecordingRes.GridWCIColRecordingLabel;
    }


<div>
    <div class="section-title">Who controls it?</div>
    <table id="tblDerivedCreationRights"></table>
</div>


    <script type="text/javascript">
        $(document).ready(function () {
            $("#tblDerivedCreationRights").kendoGrid({
                dataSource: {
                    type: "json",
                    transport: {
                        read: "/Song/SongDerivedCreationRights/@Model.Recording.Id.ToString()"
                    },
                    schema: {
                        model: {
                            fields: {
                                ProgramId: { type: "string" },
                                TerritoryName: { type: "string" },
                                PrimaryPartyName: { type: "string" },
                                PrimaryRightshareSetName: { type: "string" }
                            }
                        }
                    },
                    pageSize: 100,
                    serverPaging: false,
                    serverSorting: true
                },
                scrollable: true,
                sortable: { mode: "single", allowUnsort: false },
                pageable: false,
                columns: [
                    { field: "ProgramId", title: '@colProgram', width: 75 },
                    { field: "TerritoryName", title: '@colTeritoryName', width: 100 },
                    { field: "PrimaryPartyName", title: '@colParty', width: 100, template: '<a href="/Party/Details?id=#=PartyId#">#=PrimaryPartyName#</a>' },
                    { field: "PrimaryRightshareSetName", title: '@colCatalog', width: 200, template: '<a href="/RightshareSet/Details?id=#=RightshareSetId#">#=PrimaryRightshareSetName#</a>' }
                    //{ field: "", title: "", template: "" }
                ]
            });
        });


    </script>
 }
Yousung
Top achievements
Rank 1
 answered on 01 Apr 2016
1 answer
833 views

I have a dropdownlist with multiple columns.

When a user wants to filter something, i want to retrieve all the records which contains the filter text in any column, not only on text column.
I have tried to manage the filter event, and change the filter, but its not working. What is it wrong with my code?

01.@(Html.Kendo().DropDownList()
02.                                        .Name("CEBE")
03.                                        .HtmlAttributes(new { style = "width:100%" })
04.                                        .OptionLabel("Seleccione...")
05.                                        .HeaderTemplate("<div class=\"dropdown-header k-widget k-header\">" +
06.                                            "<table><tr>" +
07.                                            "<td style='width:110px'>CEBE</td>" +
08.                                            "<td>Nombre</td>" +
09.                                            "</tr></tabla>" +
10.                                            "</div>")
11.                                        .Template("<span class=\"k-state-default\"></span>" +
12.                                            "<span class=\"k-state-default\">" +
13.                                            "<table><tr>" +
14.                                            "<td style='width:110px; padding-right:5px;'>#: data.Codigo#</td>" +
15.                                            "<td style='width:auto;'>#: data.Nombre#</td>" +
16.                                            "</tr></table>" +
17.                                            "</span>")
18.                                        .DataTextField("Nombre")
19.                                        .DataValueField("Codigo")
20.                                        .Filter(FilterType.Contains)
21.                                        .Events(e=> e.Filtering("filterCebe"))
22.                                        .BindTo((List<Sample.MaestrosService.CEBE>)ViewBag.ListaCebesUtilizados)
23.                                    )
24. 
25.
26.<script text="text/javascript">
27.function filterCebe(e) {
28.        debugger;
29.        var filterValue = e.filter.value;
30.        var newFilter = {
31.            logic: "or",
32.            filters: [
33.                { field: "Nombre", operator: "contains", value: filterValue, ignoreCase: true },
34.                { field: "Codigo", operator: "contains", value: filterValue, ignoreCase: true }
35.            ]
36.        };
37.        var dll = $("#CEBE").data("kendoDropDownList");
38.        dll.dataSource.filter(newFilter);
39.    } </script>

 

 

Nikolay Rusev
Telerik team
 answered on 01 Apr 2016
2 answers
114 views

Ok, I found this thread http://www.telerik.com/forums/chart-pan-zoom-feature-without-setting-the-datasource-property which says you should use a dataSource for panning and zooming.  That was a couple years, and I want to make sure nothing has been updated and you still have to use a dataSource.

 

This is related to my other multi-axis and zooming and panning question because before I was using series data and it was working well, but since apparently we have to use dataSource for panning and zooming I'm having some issues.

Are there any examples of multi-axis with panning and zooming?

 

James
Top achievements
Rank 1
 answered on 01 Apr 2016
2 answers
479 views

Decimal separator changes comma to dot when focused to update cell. see in attached images.

 

Notes:

GridEditMode.InCell

------------

columns.Bound(p => p.ALIS_FIYATI).Width(220).Format("{0:n2}"); 

-------------

    <script src="@Url.Content("~/Scripts/kendo/cultures/kendo.culture.tr-TR.min.js")"></script>
    <script>
        kendo.culture("tr-TR");
    </script>

 

Kursad Nebi
Top achievements
Rank 1
 answered on 01 Apr 2016
1 answer
290 views

Hi there,

I currently have an issue where we have a kendoSplitter that splits a ui-view in two. In the left part of the splitter, I have a kendoGrid and below that I have a kendoWindow definition (in angular).

I have a button that, on click, will center my windows and then open it.

The problem is that my window is not centered at all, it seems to be stuck in the left part of the splitter. Also when my grid have a lot of data and there is a scroll, it will open the window all the way down of the scroll.

 

Is there any way to fix this ?
Do I have to manually place the window using Javascript and CSS or is there an automatic thing to do ?!

 

Thanks in advance !

Dimo
Telerik team
 answered on 01 Apr 2016
1 answer
215 views
1down votefavorite How can i disable character encoding in kendo mvvm value binding? I have already encoded string and trying to bind it
<input name='myText' data-bind='value: MyText'></input>
but i get codes of letters instead of normal text value. How can i prevent double encoding in this example?
Alexander Popov
Telerik team
 answered on 01 Apr 2016
1 answer
122 views

I'm using the datasource below as input to a bar chart.

How can I use the same datasource as input to a TreeMap chart? Or must I do another database call?

[{"category":"Decisive + Very","value":206,"explode":false,"color":"#3073ad"},{"category":"Decisive + Satisfied","value":14,"explode":false,"color":"#428bca"},{"category":"Major + Very","value":374,"explode":false,"color":"#2b772b"},{"category":"Major + Satisfied","value":175,"explode":false,"color":"#3c9b3d"},{"category":"Major + Neither","value":6,"explode":false,"color":"#64c465"},{"category":"Major + Slightly","value":2,"explode":false,"color":"#8dd68e"},{"category":"Some + Very","value":37,"explode":false,"color":"#b36d0e"},{"category":"Some + Satisfied","value":86,"explode":false,"color":"#f0910f"},{"category":"Some + Neither","value":17,"explode":false,"color":"#f0ad4e"},{"category":"Some + Slightly","value":3,"explode":false,"color":"#f1c68b"},{"category":"Minor + Very","value":1,"explode":false,"color":"#9d2a27"},{"category":"Minor + Satisfied","value":8,"explode":false,"color":"#cf322e"},{"category":"Minor + Neither","value":6,"explode":false,"color":"#d86562"},{"category":"Minor + Slightly","value":7,"explode":false,"color":"#e09290"},{"category":"Minor + Dissatisfied","value":4,"explode":false,"color":"#eececa"},{"category":"No + Satisfied","value":1,"explode":false,"color":"#4b4b4b"},{"category":"No + Neither","value":4,"explode":false,"color":"#747474"},{"category":"No + Slightly","value":3,"explode":false,"color":"#9c9c9c"}]

Daniel
Telerik team
 answered on 01 Apr 2016
1 answer
680 views

Hello all,

I need to make a KendoUI Grid with TabStrip detail template(like http://demos.telerik.com/kendo-ui/grid/detailtemplate but with one grid in every tabs)

TabStrip have 3 tabs.

I need to put one grid in every tab.

Works fine with one grid, but no works with many.

In function detailInit when i try to create the second tab "detailRow.find(".plata").kendoGrid" obtain "kendo.web.js:44029 Uncaught TypeError: Cannot read property 'locked' of undefined".

Below is a part of the code:

<script type="text/x-kendo-template" id="template">
    <div class="tabstrip">
        <ul>
            <li class="k-state-active">
               Cantitativ
            </li>
            <li>
                Plata
            </li>
            <li>
                Expeditie
            </li>
        </ul>
        <div>
            <div class="cantitativ"></div>
        </div>
        <div>
            <div class="plata"></div>
        </div>
        <div>
            <div class="expeditie"></div>
        </div>
    </div>

</script>

.....

function detailInit(e) {

 var detailRow = e.detailRow;
detailRow.find(".tabstrip").kendoTabStrip({
    animation: {
        open: { effects: "fadeIn" }
    },
});

detailRow.find(".cantitativ").kendoGrid({

....

});

detailRow.find(".plata").kendoGrid({
....
});

thanks,

Vasile
Top achievements
Rank 1
 answered on 01 Apr 2016
1 answer
931 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
440 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
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
Drag and Drop
Application
Map
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
DropDownTree
ListBox
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
Styling
ColorPicker
Pager
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
Licensing
PivotGridV2
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
LLM Kit
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?