Telerik Forums
Kendo UI for jQuery Forum
4 answers
227 views
Hi, I have a filter on the left side of my web and a grid with the result on the left side. By default that grid is empty, but when I submit the filter form the result should be shown in this grid. I am using kendo spa and mvvm so my observable (model) is something like this:

var vm = kendo.observable({
     getAgentOnlyFound: function(){....},
});

where getAgentOnlyFound get the data in json format from the server, so... 

var dataSourceOnlyFound = new kendo.data.DataSource({
                    transport: {
                        read: function(options) {
                            options.success(vm.getAgentOnlyFound());
                        },
                    },
                    schema: {
                        parse: function (data) {

                            $.each(data, function (i, val) {
                                val.EffectiveDate = kendo.toString(new Date(parseInt(val.EffectiveDate.substr(6))), "MMM/dd/yyyy");
                            });

                            return data;
                        },
                        model: {
                            id: "Id"
                        }
                    }
                });

$("#agent-list-grid").data("kendoGrid").setDataSource(dataSourceOnlyFound);

and my html:

<div id="agent-list-grid"
     data-role="grid"
     data-editable="false"
     data-columns="[
        { 'field': 'FullName', title: 'Agent Name', 'width': 270 },
        { 'field': 'Country.Name', title: 'Country' },
        { 'field': 'EffectiveDate', title: 'Effective Date' }]"
     data-bind="visible: isListView">

the real example is pretty much large but I just put here the important part. My problem is: this example works in random way. Sometime it works and sometime doesn't and I do not receive any javascript errors from my browser.

Any idea ??

Thanks in advance...
Nikolay Rusev
Telerik team
 answered on 16 Sep 2014
2 answers
108 views
Hi,

It seems to me TreeView element is not working correctly for such scenario.

1. Read action controller sets checked attribute to true if corresponding item can be found in specific table or has an ancestor item found in that table.
2. There is a TreeView element with checkboxes enabled, checkChildren and loadOnDemand are turned on.

Workflow: user unchecks some item, which has children and was checked before, but not expanded. Then user expands the node, and all checks return back, because they are assigned to subitems based on the status in table without considering the fact that some change has happened on front-end already.

Similarly, if neither an item, nor any of its sub-items was checked, then item gets checked, then expanded - all checks will disappear.

I do understand that this is a complex issue, but please advise what options do I have now, except of advising users not to expand after checking or unchecking, or to expand before checking or unchecking?

Please note that if I do loadOnDemand = true, it will take terrible time to apply all checks accordingly (the number of treeview items is hundreds already and will grow).

Thank you.
Alex Gyoshev
Telerik team
 answered on 16 Sep 2014
1 answer
137 views
Hi Team,

We have a requirement where-in we have to visually represent a real-time series data (time against the value). 
We had found your kendo chart demo interesting provided under your web-site

DATA VISUALIZATION -> Chart API -> Benchmark

In the Benchmark chart, the chart is moving. Aloing with it we like to add navigator. This navigator should try to persist
start range data and end range data somewhere locally.

We like to have backward and forward playback controls to this Benchmark chart to view the trend back and forth.
Currently play and pause functions are available in the demo.

We also want crosshair to be available over the catergory axis by default all the time during running of the trend chart
instead on mouse hover.

Please help us out.

Thanks,
Siva
Hristo Germanov
Telerik team
 answered on 16 Sep 2014
4 answers
563 views
Hi,

When a form loads we want to highlight which fields are required fields by changing the colour of the label.  If you look at the attached image SoureRequiredAuthorNotRequired.PNG you can see the Source field is highlighted in red as it is a required field.  When a value is entered for the Source the red highlighting disappears.

To do this we have used:

<div class="form-group" ng-class="{'has-error' : editForm.Source.$error.required}">
    <label for="Source" class="control-label required">Source</label>
    <input type="text" id="Source" name="Source" ng-model="vm.data.record.source" class="form-control input" required />
</div>
 
<div class="form-group">
    <label for="Author" class="control-label">Author</label>
    <input type="text" id="Author" name="Author" ng-model="vm.data.record.author" class="form-control input" />
</div>

We have now added in a Kendo date picker and hoped this would work in the same way:

<div class="form-group" ng-class="{'has-error' : editForm.PressCuttingDate.$error.required}">
    <label for="PressCuttingDate" class="control-label required">Date</label>
    <input type="date" kendo-date-picker id="PressCuttingDate" name="PressCuttingDate" k-ng-model="vm.data.record.pressCuttingDate" k-format="'dd/MM/yyyy'" style="width: 100%" required />
</div>
 
<div class="form-group" ng-class="{'has-error' : editForm.Source.$error.required}">
    <label for="Source" class="control-label required">Source</label>
    <input type="text" id="Source" name="Source" ng-model="vm.data.record.source" class="form-control input" required />
</div>
 
<div class="form-group">
    <label for="Author" class="control-label">Author</label>
    <input type="text" id="Author" name="Author" ng-model="vm.data.record.author" class="form-control input" />
</div>

Unfortulately this does not work.  It seems that to validate a kendo date picker you have to use the kendo validator.  Is that correct?

Assuming that is correct, we added the following code:

<form name="editForm" novalidate kendo-validator="vm.formValidation">

to use the kendo validator.  Looking at the documentation you have a validateInput function which validates just one field:

http://docs.telerik.com/kendo-ui/api/javascript/ui/validator#methods-validateInput

We then tried:

<div class="form-group" ng-class="{'has-error' : vm.formValidation.validateInput($('input[name=PressCuttingDate]')) }">
    <label for="PressCuttingDate" class="control-label required">Date</label>
    <input type="date" kendo-date-picker id="PressCuttingDate" name="PressCuttingDate" k-ng-model="vm.data.record.pressCuttingDate" k-format="'dd/MM/yyyy'" style="width: 100%" required />
</div>

Which did not work.  validateInput only seems to work if it used as part of a button click.  Is this correct?

How can I get this to work so that the red highlighting appears when nothing has been entered and disappears when a value has been entered (without the user clicking on a save button etc)?

Many thanks
Petyo
Telerik team
 answered on 16 Sep 2014
7 answers
231 views
Is there a way to change the relative position of a donut chart's tooltip?

If my chart is close to the edge of my RadDock, the tooltip is chopped off or I get an unsightly scrollbar.  I am attaching a screenshot and pasting an example of the undesired behavior:

Thank you,
Anthony

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Default" %>
 
<!DOCTYPE html >
<html>
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
    <style>
        .appboundary {
            padding: 10px;
            width: 100%-40px;
            height: 100%;
            background-color: #fff;
            margin: 20px;
            -moz-box-shadow: 0 0 0 4px #FFF, inset 1px 0px 10px #C3C4C7, 0px 1px 6px 6px rgba(10,0,0,.5);
            -webkit-box-shadow: 0 0 0 4px #FFF, inset 1px 0px 10px #C3C4C7, 0px 1px 6px 6px rgba(10,0,0,.5);
            box-shadow: 0 0 0 4px #FFF, inset 1px 0px 10px #C3C4C7, 0px 1px 6px 6px rgba(10,0,0,.5);
            -webkit-border-radius: 1px;
            -moz-border-radius: 1px;
            border-radius: 1px;
        }
    </style>
</head>
<body>
 
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script src="http://cdn.kendostatic.com/2013.1.319/js/kendo.all.min.js"></script>
        <script>
            function createChart() {
                $("#donutholder").kendoChart({
                    title: {
                        visible: false
                    },
                    legend: {
                        visible: false
                    },
                    chartArea: {
                        background: "",
                        height: 180,
                        width: 180
                    },
                    seriesDefaults: {
                        type: "donut",
                        startAngle: 90,
                        holeSize: 60,
                        size: 20,
                        overlay: {
                            gradient: "sharpBevel"
                        }
                    },
                    series: [
                        {
                            data: [
                                {
                                    category: "Promoted",
                                    value: 2,
                                    color: "#931d2f"
                                },
                                {
                                    category: "Failed Attempts",
                                    value: 1,
                                    color: "#e4a612"
                                }
                            ],
                            labels: {
                                visible: false,
                                background: "transparent",
                                position: "outsideEnd",
                                template: "#= category #: #= value#%"
                            }
                        }
                    ],
                    tooltip: {
                        visible: true,
                        template: "#= category #: #= value#"
                    }
                });
            }
 
            $(document).ready(function () {
                setTimeout(function () {
                    createChart();
                }, 400);
            });
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <div>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
                <telerik:RadDockLayout runat="server" ID="RadDockLayout1">
                    <telerik:RadDockZone ID="RadDockZone1" runat="server" CssClass="appboundary" FitDocks="True" BorderStyle="None"
                        Style="max-width: 1200px">
                        <telerik:RadDock runat="server" ID="RadDock1" DefaultCommands="ExpandCollapse"
                            DockMode="Docked" EnableDrag="False" EnableAnimation="True">
                            <ContentTemplate>
                                <div style="float: right" id="donutholder">
                                </div>
                            </ContentTemplate>
                        </telerik:RadDock>
                    </telerik:RadDockZone>
                </telerik:RadDockLayout>
            </telerik:RadAjaxPanel>
        </div>
    </form>
</body>
</html>


Jo
Top achievements
Rank 1
 answered on 16 Sep 2014
3 answers
212 views
Hello.  I'm trying to talk to a Rails app using REST & json. I'm having problem passing custom group parameter. I tried various different hacks but nothing seems to work. Here my code ( I made it as simple as possible to make sure it run and I'm still getting an error)


The service I'm passing params to requires them to be passed like so:  
http://localhost/products/search?page=1&per=10&group_by=manufacturer_id+asc&order_by=vendor_id+asc,vendor_number+desc

Sorting (order_by) - works fine. But grouping causes an error: Uncaught TypeError: undefined is not a function  

Here is my code:




crudServiceBaseUrl = "/products";

productsDataSource = new kendo.data.DataSource({
  autoSync: true,
  pageSize: 10,
  serverPaging: true,
  serverSorting: true,
  serverGrouping: true,
  schema: {
    data: "products",
    total: "count"
  },
  batch: false,
  transport: {
    read: {
      url: crudServiceBaseUrl + "/search",
      dataType: "json",
      contentType: "application/json",
      type: "GET"
    },
    update: {
      url: function(expense) {
        return crudServiceBaseUrl + "/" + expense.id;
      },
      dataType: "json",
      contentType: "application/json",
      type: "PUT"
    },
    destroy: {
      url: function(expense) {
        return crudServiceBaseUrl + "/" + expense.id;
      },
      dataType: "json",
      type: "DELETE"
    },
    create: {
      url: crudServiceBaseUrl,
      dataType: "json",
      contentType: "application/json",
      type: "POST"
    },
    parameterMap: function(data, type) {
      if (type === "read") {
        return {
          page: data.page,
          per: data.pageSize,
          group_by: function() {
            var groupings;
            if (typeof data.group === "undefined") {
              return "";
            } else {
              groupings = $.makeArray(data.group);
              return $.map(groupings, function(g) {
                return g.field + " " + g.dir;
              }).join(",");
            }
          },
          order_by: function() {
            var sortings;
            if (typeof data.sort === "undefined") {
              return "";
            } else {
              sortings = $.makeArray(data.sort);
              return $.map(sortings, function(s) {
                return s.field + " " + s.dir;
              }).join(",");
            }
          }
        };
      }
    }
  }
});

products_grid = $("#products_grid").kendoGrid({
  dataSource: productsDataSource,
  groupable: true,
  sortable: {
    mode: "multiple",
    allowUnsort: true
  },
  pageable: true
});

Nick
Top achievements
Rank 1
 answered on 15 Sep 2014
3 answers
1.5K+ views
Hy,

I've got a Column with DateTime Values! eg.: "2014/09/11 10:00"

Our Customer wants to filter the Column by Datepicker and only one field (filterable.extra: false) - so if I add a Datepicker Filter (not DateTimepicker) and wanna filter "is equal" to "2014/09/11" the Grid don't wanna display anything - Problem ist that the filtered Date is "2014/09/11 00:00", whicht isn't equal because of the time - how can I fix this issue?

In the Column I have to display the date with the time, filtering should ignore the time!

greetings from Austria
Flo
Kiril Nikolov
Telerik team
 answered on 15 Sep 2014
4 answers
180 views
I tried updating my grid to use 2014.2.903 version of kendo.min.js and kendo.angular.min.js, but when I do, code that was working formerly no longer works.

Specifically this snippet in the initialization of grid columns is where I get an error:

filterable: {
extra: false,
cell: {
template: function (input) {
input.kendoDropDownList({

It complains that kendoDropDownList is not something that can be done to "input". Type of input shows as Object, or if you look further into the properties it is correctly identified as an INPUT.

Putting back the former *.js files returned my app to working as before.

Bob Graham

Alexander Popov
Telerik team
 answered on 15 Sep 2014
1 answer
252 views
Hello
I have following data:

user_id, user_first_name, user_surname, some_other_data

On Grid I'm displaying it in following way

UserDisplayName (user_first_name + ' '+ user_surname), Some Data

Now I would like to group data by user. So in fact on database level it should be grouped by user id but then it should display in grid group header proper user display name.

I know how to achieve such grouping by simply replacing proper memeber in group descriptor on DataSourceRequest object, but Then group header is wrong.
Probably it would be possible to somehow on fly replace that values?

But I believe it would be still a problem with sorting.

Is such server grouping is possible? In linq I can define multiple columns to group, but have no idea how to apply that to data source.

Kind Regards
Marcin
Alexander Popov
Telerik team
 answered on 15 Sep 2014
5 answers
392 views
I want to have a 'begin --> end' date range show when date columns are filtered.

This code snippet works, the first time the filter is opened:
...,
filterMenuInit: function (e) {  
            if (e.field === "DateRequested") {
                var beginOperator = e.container.find("[data-role=dropdownlist]:eq(0)").data("kendoDropDownList");
                beginOperator.value("gte");
                beginOperator.trigger("change");
 
                var endOperator = e.container.find("[data-role=dropdownlist]:eq(2)").data("kendoDropDownList");
                endOperator.value("lte");
                endOperator.trigger("change");
            }
        },
...

However, the next time it is opened, the gte option is shown for both the zero-eth and the 2nd operators. The filterMenuInit is never hit again. How can I make it persist?

Thanks, Bob Graham
Daniel
Telerik team
 answered on 15 Sep 2014
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
Drag and Drop
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
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?