Telerik Forums
Kendo UI for jQuery Forum
1 answer
1.4K+ views
Hi,
Is there anyway to hide data points with zero (0) value in a line chart? I'm currently using the line chart and can't seem to find an easy way to do this. Basically a line shows up at the 0 value on the graph and I rather not show the line at all.Provide me any solution how to remove the lines showing zero.Here i'm providing the code below


$.ajax({
                    type: "POST",
                    contentType: "application/json;charset=utf-8",
                    url: "dataVizWebService.asmx/GetSellInOfficeTrends",
                    dataType: "json",
                    success: function (data) {

                        $("#chart").kendoChart({
                            dataSource: {
                                data: data.d,
                                value: "#={0}>0"
                            },
                            legend: {
                                position: "bottom"
                            },
                            title: {
                                text: "Population"
                            },
                            series: [
                                        {
                                            type: "line",
                                            field: "Population2010",
                                            name: "Population2010",
                                            axis: "Year",
                                            color: "#4a7ebb"
                                        }, {
                                            type: "line",
                                            field: "Population2011",
                                            name: "Population2011",
                                            axis: "Year",
                                            color: "#be4b48"
                                        }, {
                                            type: "line",
                                            field: "Population2012",
                                            name: "Population2012",
                                            axis: "Year",
                                            color: "#98b954"
                                        }, {
                                            type: "line",
                                            missingValues: "zero",
                                            field: "Population2013",
                                            name: "Population2013",
                                            axis: "Year",
                                            dashType: "dash",
                                            color: "#000000"
                                        }
                                        ],
                            valueAxis: [{
                                name: "Year",
                                title: { text: "Population in Millions" }
                            }],
                            categoryAxis: {
                                field: "Week",
                                majorTickType: "none",
                                labels: {
                                    skip: 0
                                }
                            },
                            tooltip: {
                                visible: true
                            }
                        })
                    }
                });

Iliana Dyankova
Telerik team
 answered on 11 Jan 2013
1 answer
342 views
I am trying to create a conditional template to display different controls based on the item it is being bound to. In my example, I render a combobox in the second item when in edit mode. The values in the combo appear just fine until I hit save. What I see then is [object Object] where the regular template is trying to display it. How can store and show my selected value in the non-editable template?

FYI.. This is being bound to a JSON string.

[
    {"questiontext":"Please enter the first name.","control":{"type":"textbox","label":"First Name"},"answer":null,"comment":"This is where the comment goes"},
    {"questiontext":"What is the status?","control":{"type":"combobox","label":"Status:","item":[{"itemtext":"Open","itemvalue":"OP"},{"itemtext":"Canceled","itemvalue":"CO"},{"itemtext":"Closed","itemvalue":"CL"},{"itemtext":"Complete","itemvalue":"CO"}]},"answer":null,"comment":null},
    {"questiontext":"What is the status?","control":{"type":"radiobutton","label":"Status:","item":[{"itemtext":"Open","itemvalue":"OP"},{"itemtext":"Canceled","itemvalue":"CO"},{"itemtext":"Closed","itemvalue":"CL"},{"itemtext":"Complete","itemvalue":"CO"}]},"answer":null,"comment":null},
    {"questiontext":"What was the date of the incident?","control":{"type":"datetime","mask":"datetime","label":"Date:"},"answer":null,"comment":null}
]


<!DOCTYPE html>
<html>
<head>
    <title>Editing</title>
    <link href="../../iqaListTest/content/kendo/2012.3.1114/examples-offline.css" rel="stylesheet">
    <link href="../../../iqaListTest/content/kendo/2012.3.1114/kendo.common.min.css" rel="stylesheet">
    <link href="../../../iqaListTest/content/kendo/2012.3.1114/kendo.default.min.css" rel="stylesheet">
 
    <script src="../../../iqaListTest/scripts/kendo/2012.3.1114/jquery.min.js"></script>
    <script src="../../../iqaListTest/scripts/kendo/2012.3.1114/kendo.web.min.js"></script>
    <script src="../../iqaListTest/scripts/kendo/2012.3.1114/console.js"></script>
</head>
<body>
    <a class="offline-button" href="../index.html">Back</a>
    <div id="example" class="k-content">
    <div class="k-toolbar k-grid-toolbar">
        <a class="k-button k-button-icontext k-add-button" href="#"><span class="k-icon k-add"></span>Add new record</a>
    </div>
         
    <div class="listview-holder">
        <div id="listView"></div>
    </div>
 
    <!--<div id="pager" class="k-pager-wrap">
    </div>-->
 
    <script type="text/x-kendo-tmpl" id="template">
        <div class="iqa-view">
            <dl>
                <dt>Question</dt>
                <dd>${questiontext}</dd>
                <dt>${control.label}</dt>               
                <dd>${answer} </dd>
                <dt>Comment</dt>
                <dd>${comment}</dd>
            </dl>
            <div class="edit-buttons">
                <a class="k-button k-button-icontext k-edit-button" href="\\#"><span class="k-icon k-edit"></span>Edit</a>
                <a class="k-button k-button-icontext k-delete-button" href="\\#"><span class="k-icon k-delete"></span>Delete</a>
            </div>
        </div>
    </script>
 
    <script type="text/x-kendo-tmpl" id="editTemplate">
        <div class="iqa-view">
            <dl>
                <dt>Question</dt>
                <dd>${questiontext}</dd>
                <dt>${control.label}</dt>
                <dd>
                    #if (control.type == 'textbox')  { #
                         <input type="text" data-bind="value:answer" name="answer" required="required" validationMessage="required" />
                         <span data-for="answer" class="k-invalid-msg"></span>
                    # } else if (control.type == 'combobox')  { #
                        <select data-role="combobox" data-text-field="itemtext" data-value-field="itemvalue" data-bind="source:control.item, value:answer"></select
                    # } #         
                </dd>
                <dt>Comment</dt>
                <dd>${comment}</dd>
            </dl>
            <div class="edit-buttons">
                <a class="k-button k-button-icontext k-update-button" href="\\#"><span class="k-icon k-update"></span>Save</a>
                <a class="k-button k-button-icontext k-cancel-button" href="\\#"><span class="k-icon k-cancel"></span>Cancel</a>
            </div>
        </div>
    </script>
 
    <script>
        $(document).ready(function () {
            var dataSource = new kendo.data.DataSource({
                transport: {
                    read: {
                        url: "iqaData.txt",
                        dataType: "json"
                    }
                }
            });           
 
            var listView = $("#listView").kendoListView({
                dataSource: dataSource,
                template: kendo.template($("#template").html()),
                selectable: "single",
                editTemplate: kendo.template($("#editTemplate").html())
            }).data("kendoListView");
 
            $(".k-add-button").click(function (e) {
                listView.add();
                e.preventDefault();
            });
        });
    </script>
    <style scoped>
        .iqa-view
        {
            float: left;
            width: 650px;
            margin: 5px;
            padding: 3px;
            -moz-box-shadow: inset 0 0 50px rgba(0,0,0,0.1);
            -webkit-box-shadow: inset 0 0 50px rgba(0,0,0,0.1);
            box-shadow: inset 0 0 50px rgba(0,0,0,0.1);
            border-top: 1px solid rgba(0,0,0,0.1);
            -webkit-border-radius: 8px;
            -moz-border-radius: 8px;
            border-radius: 8px;
        }
 
        .listview-holder
        {
            width: 700px;
            margin: 0 auto;
            padding: 0;
            border: 0;
            border: 1px solid rgba(0,0,0,0.1);
            height: 400px;
            overflow: auto;
        }
 
        .iqa-view dl
        {
            margin: 10px 0;
            padding: 0;
            min-width: 0;
        }
        .iqa-view dt, dd
        {
            float: left;
            margin: 0;
            padding: 0;
            height: 30px;
            line-height: 30px;
        }
        .iqa-view dt
        {
            clear: left;
            padding: 0 5px 0 15px;
            text-align: right;
            opacity: 0.6;
            width: 100px;
        }
        .k-listview
        {
            border: 0;
            padding: 0;
            min-width: 0;
        }
        .k-listview:after, .iqa-view dl:after
        {
            content: ".";
            display: block;
            height: 0;
            clear: both;
            visibility: hidden;
        }
        .edit-buttons
        {
            text-align: right;
            padding: 5px;
            min-width: 100px;
            border-top: 1px solid rgba(0,0,0,0.1);
            -webkit-border-radius: 8px;
            -moz-border-radius: 8px;
            border-radius: 8px;
        }
 
        .k-toolbar, #listView
        {
            width: 660px;
            margin: 0 auto;
            -webkit-border-radius: 11px;
            -moz-border-radius: 11px;
            border-radius: 11px;
        }
         
        span.k-invalid-msg
        {
            position: absolute;
            margin-left: 160px;
            margin-top: -26px;
        }
    </style>
</div>
</body>
</html>
Alexander Valchev
Telerik team
 answered on 10 Jan 2013
1 answer
231 views
Team,

I have a html grid which has input value that consists of datetimepicker.

I have grid with 3 rows ans when I tried to tag kendo datepicker to the column, it is visible only for the first row.

Am I missing some thing..
Iliana Dyankova
Telerik team
 answered on 10 Jan 2013
2 answers
458 views
After implementing the following javascript to align the Update and Cancel popup editors buttons to the right they now display in the incorrect order, i.e. Cancel then Update.

function onGridEdit(e){
      e.container.find('.k-grid-update,.k-grid-cancel').css('float','right');
}

How do I get the buttons on the right and remain in the Update, Cancel display order?
Robert
Top achievements
Rank 1
 answered on 10 Jan 2013
1 answer
96 views
Hi,
I need to use Kendo UI Slider Vertically from top to bottom with ASP.NET MVC helper. It is possible to render it:
- Left to Right: Horizontally, no RTL
- Right to Left: Horizontally, RTL
- Bottom to Top: Vertically, RTL or not
- Top to Bottom: ???

Regards.
Hristo Germanov
Telerik team
 answered on 10 Jan 2013
1 answer
326 views
Hi, 

I would like to programatically select the text of a combobox, so the user can write and get suggestions without having to delete the content of the combobox manually. Is there a way to do this? 

Thank you very much :)
Daniel
Top achievements
Rank 1
 answered on 10 Jan 2013
4 answers
325 views
Add new record crashes when having a filter that filters all rows
See sample below.
Steps to reproduce;
1) In the grid, set filter to First Name = "xyz" , result:  all records filtered.
2) Press Add new record button , result:
    Microsoft JScript runtime error: Unable to get value of the property 'ID': object is null or undefined

<div id="grid">
</div>
<script type="text/javascript">
    $(document).ready(function () {

        var ds = new kendo.data.DataSource({
            schema: {
                model: {
                    id: "ID",
                    fields: {
                        ID: { type: "number", editable: false, nullable: true },
                        FirstName: { type: "string" },
                        LastName: { type: "string" }
                    }
                }
            },
            data: [
                         { ID: "1", FirstName: "Joe", LastName: "Smith" },
                         { ID: "2", FirstName: "Jane", LastName: "Hilton" }
                      ]
        });

        $("#grid").kendoGrid({
            dataSource: ds,
            columns: [
                        { field: "ID", title: "ID" },
                        { field: "FirstName", title: "First Name" },
                        { field: "LastName", title: "Last Name" }
                     ],
            toolbar: ["create", "save", "cancel"],
            editable: true,
            navigatable: true, // tab thru the cells
            autoBind: true,
            sortable: true,
            filterable: true,
            scrollable: false
        });

    });
</script>

Rosen
Telerik team
 answered on 10 Jan 2013
11 answers
618 views
Hi,

I've seen a few examples of filtering, but never with a listview using range sliders. Pretty much all of the examples I've seen involve filtering a grid with a dropdown. I am curious about filtering a listview with multiple range sliders. I know how to filter a listview but don't know how to hook up the range sliders to do the filtering (on change, on slide). Could someone please point me in the right direction?

This is what I have so far:
<!DOCTYPE html>
<head id="Head1" runat="server">
    <title></title>
 
    <link rel="Stylesheet" href="search.css" type="text/css" />
     
    <link href="examples-offline.css" rel="stylesheet">
    <link href="kendo.common.min.css" rel="stylesheet">
    <link href="kendo.default.min.css" rel="stylesheet">
 
    <script src="jquery.min.js"></script>
    <script src="kendo.web.min.js"></script>
    <script src="console.js"></script>
 
</head>
 
 
<body>
     <form id="form1" runat="server">
     <div  class="content">
      
     <div class="menuholder">
        <div class="menu"></div>
     </div>
 
      
     <div class="holder">
      
      
     <div class="params">
 
                <div id="rangeslider" class="humidity">
                    <input />
                    <input />
                </div>
 
    </div>
     
     <div class="vspacer"></div>
      
     <div class="display">
 
         <div id="example" class="k-content">
 
    <div id="listView"></div>
 
 
    <script type="text/x-kendo-tmpl" id="template">
        <div class="product">
            <img src="myimg.jpg" alt="${ProjectName} image" />
            <h3>${ProjectName}</h3>
            <div class="edit-buttons">
                <a class="k-button k-button-icontext k-update-button" href="\\#">Btn1</a>
                <a class="k-button k-button-icontext k-cancel-button" href="\\#">Btn2</a>
 
            </div>
        </div>
    </script>
 
    <script>
     
        $(document).ready(function() {
         
            var dataSource = new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: "jsonfile.json",
                            dataType: "json"
                        }
                    },
                     
                    filter: {
                            logic: "or",
                            filters: [ {field: "ProjectName", operator: "startswith", value: "C" },
                            {field: "ProjectName", operator: "startswith", value: "A" } ]
                    },
                     
 
                });
 
 
            $("#listView").kendoListView({
                dataSource: dataSource,
                selectable: "multiple",
                template: kendo.template($("#template").html())
            });
             
            $(".k-add-button").click(function(e) {
                listView.add();
                e.preventDefault();
            });
             
 
                    $("#rangeslider").kendoRangeSlider({
                        min: 0,
                        max: 10,
                        smallStep: 1,
                        largeStep: 2,
                        tickPlacement: "both"
                    });                
        });
         
         
    </script>
 
</div>
     </div>
      
     </div>
     </div>
     </form>
</body>
</html>
All I've done is look at the examples and try to apply them, as you can see above. The filtering, as is, works - except it isn't hooked up to any range sliders. Would appreciate any help.
TIA
Alexander Valchev
Telerik team
 answered on 10 Jan 2013
12 answers
527 views

Hi, we implemented a reorderable Kendo TabStrip using jQuery UI's Sortable plugin, but are converting it to use Kendo's Reorderable widget in order to eliminate the jQuery UI dependency.  This works fine for a static TabStrip, but if you add a new tab (e.g., via append()), it seems the only reasonable way to have the newly added tab be a DropTarget is to re-apply the Reorderable widget.  See this JSFiddle:

http://jsfiddle.net/6v8Su/12/

As you can see, we call applyReorderable() every time a new tab is added, which seems less than ideal and potentially prone to memory leaks/inefficiencies.

I had initally wanted to simply add a new DropTarget to the new tab, analogous to what is done inside Reorderable (lines 10027-11069 of kendo.web.js, 2012.2.710).  However, this would require essentially duplicating nearly the entire Reorderable class in our code (including toggleHintClass() from inside the Reorderable module closure).

So I decided to fall back on the brute-force approach of re-applying the Reorderable widget every time a tab is added.  Is there a better way to do this?  Will there be memory leaks doing it this way, due to event handlers and/or DOM elements not being detached, etc?  I know that there are plans to add destroy() methods to all widgets, but as far as I understand, that is not ready at this time.

The approach in the JSFiddle seems to work, but is not elegant and seems potentially prone to memory issues.  If you have any suggestions on how to accomplish this in a more efficient manner, it would be appreciated.  Thanks!

ryan

p.s. A second question: jQuery UI's Sortable plugin will actually reorder the DOM elements upon dropping in the new location.  Kendo does not actually reorder the Reorderable elements, but simply triggers an event that describes the reordering attempt (see onReorderableChange() in my JSFiddle, where I have to reorder the .k-item tabs manually).  Are there plans to have Reorderable actually reorder its elements?  I realize that I will still need to reorder the content <div>s that correspond to the tabs, but it would be nice if Reorderable actually performed the reordering of its elements.
Dimo
Telerik team
 answered on 10 Jan 2013
4 answers
77 views
I was looking for the  columnReorder event in the API reference but coudn't find it. Therefore we managed to bind the drag end event like this.


   var draggable = $('#resultGrid .k-grid-header thead').data('kendoDraggable'); /

   draggable.bind("dragend", function (e) {

                       ///

    });


 Is it there with the new version ?
Alexander Valchev
Telerik team
 answered on 10 Jan 2013
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
Date/Time Pickers
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)
SPA
Filter
Drawing API
Drawer (Mobile)
Globalization
Gauges
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
OrgChart
TextBox
Effects
Accessibility
ScrollView
PivotGridV2
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Collapsible
Localization
MultiViewCalendar
Touch
Breadcrumb
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
Popover
DockManager
FloatingActionButton
TaskBoard
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
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?