Telerik Forums
Kendo UI for jQuery Forum
3 answers
529 views

I'm trying to sort a grid but it simply will not work no matter what I try. I'm using MVC but the JS version of Kendo UI. I've tried server sorting both on and off and several of the sorting options from the API, but it doesn't work. I use Chrome but I tried in IE, same problem, so I don't think it's a problem with stable sorting. Attempting to sort changes the order (not sorted, but it changes), then changing the sort direction after that has no effect at all. I'm using a row template, then applying the sort capability to it inside the grid initializer script.

What does my server need to return to fix sorting, or what am I doing wrong?

This is the row template:

01.<script id="rowTemplate" type="text/x-kendo-tmpl">
02.    <tr>
03.        <td class="tdalign">
04.            <a href="/Controller/Info/#:data.Id#">#:PONumber#</a>
05.        </td>
06.        <td class="tdalign">
07.            #:Col1#
08.        </td>
09.        <td class="tdalign">
10.            #:Col2#
11.        </td>
12.        <td class="tdalign">
13.            #:Col3#
14.        </td>
15.        <td>
16.            <span class="descUppercase">#:Col4#</span>
17.        </td>
18.        <td class="tdalign">
19.            #:Col5#
20.        </td>
21.        <td class="tdalign">
22.            #:Col6#
23.        </td>
24.        <td class="tdalign">
25.            #:kendo.toString(kendo.parseDate(Col7), "MM/dd/yyyy")#
26.        </td>
27.        <td class="tdalign">
28.            #:kendo.toString(kendo.parseDate(Col8), "MM/dd/yyyy")#
29.        </td>
30.        <td class="tdalign">
31.            <table>
32.                <tr>
33.                    <td class="tdalign col8TD">
34.                        <button type="button" id="Col8#:Id#" class="buttonInit Col8Button #:Col8Class1#" #:Col8Class2#>#:Col8#</button>
35.                    </td>
36.                    <td class="tdalign Col9TD">
37.                        <button type="button" id="Col9button#:Id#" class="buttonInit Col9nButton #:Col9Class1#" #:Col9Class2#>#:Col9#</button>
38.                    </td>
39.                    <td class="tdalign Col10TD">
40.                        <button type="button" id="Col10#:Id#" class="buttonInit Col10Button #:Col10Class1#" #:Col10Class2#>#:Col10#</button>
41.                    </td>
42.                </tr>
43.            </table>
44.        </td>
45.    </tr>
46.</script>

This is the initialization script:

01.$(document).ready(function () {
02.    $("#grid").kendoGrid({
03.        dataSource: {
04.            type: "json",
05.            transport: {
06.                read: {
07.                    url: "@Html.Raw(Url.Action("List", "Controller"))",
08.                    type: "POST",
09.                    dataType: "json"
10.                }
11.            },
12.            schema: {
13.                data: "Data",
14.                total: "Total",
15.                errors: "Errors"
16.            },
17.            error: function(e) {
18.                display_kendoui_grid_error(e);
19.            },
20.            pageSize: @(defaultGridPageSize),
21.            serverPaging: true,
22.            serverSorting: true
23.        },
24.        pageable: {
25.            pageSizes: [@(gridPageSizes)],
26.            info: false
27.        },
28.        editable: false,
29.        scrollable: false,
30.        mobile: true,
31.        noRecords: true,
32.        resizable: true,
33.        sortable: true,
34.        excel: {
35.            allPages: true,
36.            fileName: "Grid.xlsx",
37.        },
38.        rowTemplate: kendo.template($("#rowTemplate").html()),
39.        dataBound: function(e) {
40.            $(".buttonInit").kendoButton();
41.        }
42.    });
43.});

Boyan Dimitrov
Telerik team
 answered on 18 Nov 2015
14 answers
691 views

When I have this code in my template code:

 <a data-role="button" class="btn btn-default" data-click="launchPlayer" data-id="#= data.class_id #">Launch Class</a>

 the button doesn't get wired up and clicking doesn't call my function.

When I move it out of the template it works and calls the function.

 How do I get it to fire the event in my template?

Below is my template code.

  <script type='text/x-kendo-template' id="classtemplate">
  <h1>#= data.class_id #:  #= data.overview.class_name #</h1>
  <table class="table">
  <tbody>
  <tr>
  <td>Number of Lessons</td>
  <td>#= data.overview.lesson_total #</td>
  </tr>
  <tr>
  <td>Saved Lesson</td>
  <td>#= data.overview.saved_lesson #</td>
  </tr>
  <tr>
  <td>Difficulty</td>
  <td>#= data.overview.difficulty #</td>
  </tr>
  <tr>
  <td>Prerequisites</td>
  <td>#= data.overview.prerequisites #</td>
  </tr>
  </tbody>
  </table>
  <div class="row">
  <div class="col-sm-12">
  <h4>Description</h4>
  <div>#= data.overview.description #</div>
  </div>
  </div>
  <a data-role="button" class="btn btn-default" data-bind="click: launchPlayer" data-id="#= data.class_id #">Launch Class</a>
  </script>

 

 

 â€‹

Brad
Top achievements
Rank 1
 answered on 18 Nov 2015
1 answer
175 views

I'm using Angular directives to create my charts. I'm attempting to build a stacked column chart.  My Dojo link is here: http://dojo.telerik.com/@CloudTools/AxAbu

Normally I bind to remote json data, but I've created a static json array just to facilitate the discussion.

When I create this chart and omit the "stack: true" command from k-series-defaults, I get the values that I'd expect from each series and the value axis displays appropriate numbers.  But when I stack the series, the value axis numbers seem incorrect.  For example, in the Dojo link, you can see that the first number on the value axis is 5,000, and the maximum value axis number is 30,000 even thought the total message count on any day never exceeds 100.

Also, in the stacked column display I'd expect to see different colors for the values for each series.  However I only see green for Spam value.

I'm guessing I'm just building the stack configuration all wrong.

Is there some different way I need to format the data, rather than just flip the {stack} value?

Chris Williams
Top achievements
Rank 1
 answered on 18 Nov 2015
2 answers
473 views

Hi,

 I'am using the DTP with angular. The min-date ist set to today at 00:00:00:

$scope.dtpCfg=

{

   min: new Date(2015, 10, 9),//hardcoded example for today: Date {Mon Nov 09 2015 00:00:00 GMT+0100}

parseFormats: ["dd.MM.yyyy HH:mm"],

interval: 15

};

)



No inital value is provided to the DTP, so the DTP has no value after page load. When the user selects a date this occures:



- if a future day (e.g. tomorrow) is selected the time portion is 00:00:00 (complete: Date {Tue Nov 10 2015 00:00:00 GMT+0100}). Fine, thats assumed.

- if the date-value is set on the minimal possible day (aka today) the time portion is set to 01:00:00 (Date {Mon Nov 09 2015 01:00:00 GMT+0100}). If the browsers timezone is for example changed to China Standard Time so the time portion is 08:00:00h (Date {Mon Nov 09 2015 08:00:00 GMT+0800 (China Standard Time)}).
- if the DTP min-value is not set to today at 00:00:00 but to yesterday 23.59.59 all works fine if todays date will be selected: time portion is 00:00:00h.

 

Any ideas whtas going wrong? Is it just me? I assume always to get the time portion 00:00:00 if on an empty and fresh initialized DTP the date will be set via the ui. Thanks in advance.

Bastian
Top achievements
Rank 1
 answered on 18 Nov 2015
1 answer
86 views

I have just updated the project to the most recent MVC UI mobile version (the working version was from february 2015) and the use native scroll does not work anymore.

There is no way to scroll the listview on a windows phone 8.1.

 Any clue you might have changed to prevent the listview to work correctly?

 Thanx

Atanas Georgiev
Telerik team
 answered on 18 Nov 2015
3 answers
1.5K+ views
What is the recommended approach to subscribe to when the grid is sorted or unsorted?
Viktor Tachev
Telerik team
 answered on 18 Nov 2015
2 answers
234 views
Hi,

we're using custom grid popup editors where he have lots of different lookup controls (well not really controls, but just text with buttons).

E.g. a text-box with a button: ​one ​uses that button and it fetches a new sequence number and display that number.

Or a text-box with a customer name and a button: one uses that button and selects a customer from a customer-lookup dialog; the customer name goes into the text-box and the customer's ID goes into a hidden form field.

How to display validation errors w.r.t. *required* constraints for such common scenarios?

Easiest way would be to have text-input elements instead of text-boxes and mark those as required and readonly. But HTML5 defines readonly inputs as being immutable. Which makes me wonder how to provide an input element for validation? Or can this be achieved without input elements?

Essentially the lookup dialogs (maybe together with the selector buttons) are the input elements. Has this been addressed anywhere in the HTML5 spec?

I.e. what about input that does not live on the current form?

What about wizards with complex steps which may lead to a final form with completely broken constraints, but one cannot inform the user of those, because - according to HTML5 - obviously a readonly input cannot be wrong. Doesn't make sense to me.

Regards,

Kasimier Buchcik

Rosen
Telerik team
 answered on 18 Nov 2015
3 answers
649 views

I have a defined amount of space for a column chart and a donut chart. The column chart uses the available space properly but the donut doesn't scale to 100% percent of the height nor width.

I've highlighted the available area on the attached screenshot. Is there anything else I have to disable in order to use all the space?

 Here's to javascript code I use to create the chart:

function createDonutChart(chartId, green, red) {
    $("#" + chartId).kendoChart({
        legend: {
            visible: false
        },
        chartArea: {
            background: "",
            margin: 0
        },
        seriesDefaults: {
            labels: {
                visible: false
            },
            type: "donut",
            holeSize: 50,
            overlay: { "gradient": "none" },
            startAngle: 90
        },
        series: [{
            name: "Availability",
            data: [{
                category: "Available",
                value: green,
                color: "#34ae93"
            }, {
                category: "Unavailable",
                value: red,
                color: "#bb0d4a"
            }],
        }],
        tooltip: {
            visible: true,
            template: "#= category #: #= value #%"
        }
    });
}

Andy
Top achievements
Rank 1
 answered on 18 Nov 2015
4 answers
298 views

Hi

I'm trying to use Kendo line chart. This is what I do:

I get data via ajax call. The data contains 9 objects like this: { Year: 'int', Month: 'int', Count: 'int', Date: 'string'}. These 9 objects represent data from 4 years so there's a lot of missing data.

Then, for the missing data, I loop through the response and fill in the missing objects and push them to an array. When that is done I have a perfect, sorted array of objects for these 4 years.

Now I create the dataSource where data: 'the array I created'.

This results in a perfect chart in Firefox and IE but not in Chrome. For example, the first year only contains value for June, the sixth month, where Count: 2. In Chrome, the chart displays that year with zeros all over except for May where the count is 2.

 Can you tell me what is going on?

Iliana Dyankova
Telerik team
 answered on 18 Nov 2015
1 answer
165 views

Hello,

We are evaluating kendo Scheduler to display custom events for configurable days (1-31) and number of resources in different views. 
MultiDayView with horizontal grouping shows configured grouping dates side by side. 
(like Telerik Kendo UI Demos and sample: http://demos.telerik.com/kendo-ui/scheduler/resources-grouping-horizontal ).
Is it possible to show resources side by side to instead of days? So grouping events by date and then by resource? (see attachment)

Regards,

Udo

Vladimir Iliev
Telerik team
 answered on 18 Nov 2015
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?