Telerik Forums
Kendo UI for jQuery Forum
3 answers
266 views
Hi,

I'm trying to add a new object to a child array, which is contained within another array.

I've created a jsbin to show you exactly what I mean - are you able to help me get the newly pushed child object to display?

I would expect the text "why wont this appear after updating my view model?" to show upon it being pushed into the array but it doesn't render.

http://jsbin.com/enutew/23/edit?html,console,output

Thanks

Will
Petyo
Telerik team
 answered on 25 Sep 2015
1 answer
660 views

Hello,

 

I am trying to implement custom rules for validator, where we need to make certain input fields mandatory only when a check box is selected. But not able to get it to work, can you please point out if i missed out anything in below -

 

 

var validator = $("#form1").kendoValidator({
            errorTemplate: "<span></span>",
            validate: function (e) {
                var html = "";
                e.preventDefault();
                if (!e.valid) {
                    var errors = this.errors();
                    var requiredFieldCount = 0;
                    html += "<ul>";
                    for (var i = 0; i < errors.length; i++) {
                        if (errors[i].toLowerCase().indexOf("required") > 0 && requiredFieldCount == 0) {
                            html += "<li> Please enter mandatory Fields *</li>";
                            requiredFieldCount++;
                        }
                        else if (errors[i].toLowerCase().indexOf("required") < 0) {
                            html += "<li>" + errors[i] + "</li>";
                        }
                    }
                    html += "</ul>";
                }
                $("#errors").html($(html));
            }
        }).data("kendoValidator");

 

 

 

    

Custom Rule - 
 
$(function () {
            var container = $("#form1");
            kendo.init(container);
            container.kendoValidator({
                rules: {
                    InsuranceAmount: function (input) {
                        if (input.context.id == "" && input.val() != "") {
                            return $("#.HasInsurance:checked");                          
                        }
 
                        return true;
                    }
                }
            });
        });

Rosen
Telerik team
 answered on 25 Sep 2015
2 answers
93 views

We are having issues losing cell edits when using Sortables with Grids. Kendos own Sortable+Grid demo shows the issue if you switch on editable:

 http://demos.telerik.com/kendo-ui/sortable/integration-grid

Here is the same demo with editable switched on:

http://dojo.telerik.com/EFEVE

To reproduce the problem click in a cell and edit it, then click in another cell. The edits you made in the first cell will be lost.

If you disable the Sortable then this issue doesn't occur.

Rowan
Top achievements
Rank 1
 answered on 25 Sep 2015
1 answer
164 views

Hi Guys,

 I am having a bit of trouble binding the treeview to some JSON returned by a REST datasource. The JSON looks like this:

{
    "Links": {
    },
    "Items": [
        {
            "WebId": "E0PDGvCF_JoUerHmn03UKDRg4BjcATte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMQ",
            "Id": "01dc18e0-5e3b-11e5-89b2-005056b23c22",
            "Name": "Gas1",
            "Description": "",
            "Path": "\\\\Global AF Acceptance Environment\\Company\\Gas1",
            "TemplateName": "Gas",
            "CategoryNames": [],
            "Links": {
            }
        },
        {
            "WebId": "E0PDGvCF_JoUerHmn03UKDRgoJxXIDte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMg",
            "Id": "20579ca0-5e3b-11e5-89b2-005056b23c22",
            "Name": "Gas2",
            "Description": "",
            "Path": "\\\\Global AF Acceptance Environment\\Company\\Gas2",
            "TemplateName": "Gas",
            "CategoryNames": [],
            "Links": {
            }
        },
        {
            "WebId": "E0PDGvCF_JoUerHmn03UKDRg_fTxOXkq5RGHhgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcUk9PVCBET1dOU1RSRUFN",
            "Id": "39f1f4fd-2a79-11e5-8786-005056b23c22",
            "Name": "Root Downstream",
            "Description": "",
            "Path": "\\\\Global AF Acceptance Environment\\Company\\Root Downstream",
            "TemplateName": "",
            "CategoryNames": [],
            "Links": {
            }
        },
        {
            "WebId": "E0PDGvCF_JoUerHmn03UKDRgThKq6zpe5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcV0FURVIgSU5KRUNUT1Iy",
            "Id": "ebaa124e-5e3a-11e5-89b2-005056b23c22",
            "Name": "Water Injector2",
            "Description": "",
            "Path": "\\\\Global AF Acceptance Environment\\Company\\Water Injector2",
            "TemplateName": "Water Injector",
            "CategoryNames": [],
            "Links": {
            }
        }
    ]
}

 

But I don't know how to adapt the Treeview example to show the "Name" as the labels in the treeview and bind to the hierarchical data source. Do I need to use the Datasource.Parse functionality to extract the "Items" to kind of flatten the JSON? Many thanks for any suggestions.

<body>
     
        <a class="offline-button" href="../index.html">Back</a>
     
            <div id="example">
            <div class="demo-section k-header">
                <div id="treeview"></div>
            </div>
            <script>
                    homogeneous = new kendo.data.HierarchicalDataSource({
                        transport: {
                            read: {
                                url: serviceRoot + "/Elements",
                                dataType: "jsonp"
                            }
                        },
                        schema: {
                            model: {
                                id: "WebID",
                                hasChildren: "Links"
                            }
                        }
                    });
 
                $("#treeview").kendoTreeView({
                    dataSource: homogeneous,
                    dataTextField: "Name"
                });
            </script>
        </div>
 
 
     
</body>

Ivan
Top achievements
Rank 1
 answered on 24 Sep 2015
1 answer
107 views

I can't get the navigate event to fire, and it appears to be a bug, since the example in the documentation fails to run as well.

 http://docs.telerik.com/kendo-ui/api/javascript/ui/treeview#events-navigate

 

Boyan Dimitrov
Telerik team
 answered on 24 Sep 2015
6 answers
386 views
Hi,
  I have a kendo grid similar to the one in this example, with an difference that I need to have the columns groupable. I created a jsFiddle with this here http://jsfiddle.net/sachindra_nath/guN8G/ that demonstrates the problem.

When you try to group by the complex type - the Category column, this results into a js error - Uncaught SyntaxError: Unexpected identifier. Digging into the kendo code, I see that the data format for this column is a JS Object and when the framework attempts to create a sort object, it uses the object value rather than a property within the object. Is there a way to configure a property to use?


"Category": { "CategoryID": 1,  "CategoryName": "Beverages" }
In my application, I have many similar grids that use remote data binding with server filtering and sorting and I use the jsonp data. The above issue can be fixed if I define the complete path for the field attribute under columns. For eg:- Instead of using { field: "Category", title: "Category", ... I use { field: "Category.CategoryID", title: "Category", ...
This however changes the filters and the sorts behavior as well.

Please suggest a way out.
regards
Sachindra
Licensing
Top achievements
Rank 1
 answered on 24 Sep 2015
5 answers
678 views

I have an excel button and two custom buttons in a grid toolbar that I have pulled to the right.  There are two hyphen-like separators that I want to remove that appear just to the right of the excel button.  You can see this in the attached pciture. I tried to remove it with some very novice css but it didn't quite work.  Any ideas?

     /* hide kendo grid toolbar separators */

    .k-button.k-button-icontext.a[class*='k-grid-'] { 
        visibility:hidden;
    }

 

Bill
Top achievements
Rank 2
 answered on 24 Sep 2015
1 answer
124 views

I am trying to include as low as possible javascript code for chart to work, but I get error: Cannot read property Color of undefined.

Dojo

What else do I need?

Iliana Dyankova
Telerik team
 answered on 24 Sep 2015
4 answers
436 views

Good afternoon. I am trying to programatically print the grid details using kendo ui. The documentation states that it's as easy

as $("#export").click(function(e) {var grid = $("#grid").data("kendoGrid");     grid.saveAsPDF();});​. 

 

However I found this to not be the case. my code is as follows

 var grid = $('#Students').data('kendoGrid');
                        grid.saveAsPDF();

 And I continue to receive the following error: "Cannot Read Property 'Length' of Undefined. What in the world am I doing so wrong. I'm able to see that I have data by hovering over the grid object in debug mode in Chrome. Why on earth would I not be able to use this function?  

 

 

Please help.

 

Vincent

 

 

Radoslav
Telerik team
 answered on 24 Sep 2015
1 answer
146 views

Hi,

Can we fill the area between two line charts using angular js?

If yes please specify with example. 

Here is the chart attached I want to create.(the red part I want to get)

T. Tsonev
Telerik team
 answered on 24 Sep 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?