Telerik Forums
Kendo UI for jQuery Forum
1 answer
2.1K+ views

My kendo grid not refreshing after a edit or create a new row.I have called a angularJs service for CRUD operation.

Here's the controller

app.controller("roadInventoryCtrl", function ($scope, services) {


    $scope.gridOptions = {
        columns: [
            {
                field: "RoadCode",
                title: "Road Code",
                width: "",
                attributes: { class: "ob-right" }
            },
            {
                field: "RoadTypeId",
                title: "Type",
                readonly: true,
                width: "",
                attributes: { class: "ob-right" }
            },
            {
                field: "SerialNo",
                title: "Serial",
                width: "",
                attributes: { class: "ob-right" }
            },
            {
                field: "Name",
                width: "38%"
            },
            {
                field: "Length",
                filterable: false,
                attributes: { class: "ob-right" }
            },
            {
                field: "CrestWidth",
                title: "Crest width",
                filterable: false,
                attributes: { class: "ob-right" }
            },
            {
                field: "EmbkHeight",
                title: "Embk height",
                filterable: false,
                attributes: { class: "ob-right" }
            },
            {
                field: "Remarks",
                filterable: false
            },
            {
                command: [
                    {
                        name: "edit",
                        template: "<a data-toggle='tooltip' data-placement='left' title='edit' class='k-grid-edit k-grid-update red-tooltip'  style='width: 26px; height: 26px; vertical-align: middle; text-align: center; cursor:pointer'><span style='margin: 4px;' class='glyphicon glyphicon-edit'></span></a>",
                        text: " "

                    },
                    {
                        name: "destroy",
                        template: "<a if-role-permission=\"['PERMISSION_WORKFLOW_DEFINITION_DELETE']\" class='k-grid-delete'  style='width: 26px; height: 26px; vertical-align: middle; text-align: center; cursor:pointer' ><span style='margin: 4px;' class='glyphicon glyphicon-remove-circle target' title='delete'></span></a>",
                        text: " "
                    }, {
                        name: "map",
                        template: "<a class='k-grid-delete'  style='width: 26px; height: 26px; vertical-align: middle; text-align: center; cursor:pointer' ><span style='margin: 4px;' class='glyphicon glyphicon-map-marker target' title='map' ></span></a>",
                        text: " "
                    }, {
                        name: "info",
                        template: "<a class='k-grid-delete'  style='width: 26px; height: 26px; vertical-align: middle; text-align: center; cursor:pointer' ><span style='margin: 4px;' class='glyphicon glyphicon-info-sign target' title='info' ></span></a>",
                        text: " "
                    }, {
                        name: "pic",
                        template: "<a class='k-grid-delete'  style='width: 26px; height: 26px; vertical-align: middle; text-align: center; cursor:pointer' ><span style='margin: 4px;' class='glyphicon glyphicon-picture target' title='picture'></span></a>",
                        text: " "
                    }
                ],
                title: "",
                width: "11%"

            }
        ],

        //editable: true,
        editable: 'inline',
        toolbar: ["create"],
        pageable: true,

        dataSource: {
            pageSize: 25,
            transport: {
                read: function(e) {
                    services.getRoadInventroy()
                        .then(function success(response) {
                            e.success(response.data);
                        }, function error(response) {
                            alert('something went wrong');
                            console.log(response);
                        });
                },
                update: function(e) {
                    services.updateRoadInventory(e)
                        .then(function success(response) {
                            e.success(response.data);
                        }, function error(response) {
                            console.log(response);
                        });
                },

                destroy: function(e) {
                    services.destroyRoadInventory()
                        .then(function success(response) {
                                e.success(response.data);
                            }, function error(response) {
                                console.log(response);
                            }
                        );

                },
                create: function(e) {
                    services.createRoadInventory(e)
                        .then(function success(response) {
                                console.log(response);
                            },function error(response) {
                                console.log(response);
                            }
                        );
                }
            },
            schema: {
                model: {
                    id: "RoadCode",
                    fields: {
                        RoadCode: {
                            editable: false
                        }
                     
                    }
                }
            }
        },
        sortable: true,
        serverPaging: true,
        serverSorting: true,
        scrollable: true,
        dataBound: function () {
            this.expandRow(this.tbody.find("tr.k-master-row").first());
        },

        selectable: "row",

        filterable: {
            extra: false,
            operators: {
            string: {
                startswith: "Starts with",
                contains:"Contains"
                   
             },
             number: {
             }
           }
        }


        }



});

How can i solve this. 

My kendo grid not refreshing after a edit or create a new row.I have called a angularJs service for CRUD operation. Here's the controller

My kendo grid not refreshing after a edit or create a new row.I have called a angularJs service for CRUD operation. Here's the controller

My kendo grid not refreshing after a edit or create a new row.I have called a angularJs service for CRUD operation. Here's the controller

My kendo grid not refreshing after a edit or create a new row.I have called a angularJs service for CRUD operation. Here's the controller

My kendo grid not refreshing after a edit or create a new row.I have called a angularJs service for CRUD operation. Here's the controller

My kendo grid not refreshing after a edit or create a new row.I have called a angularJs service for CRUD operation. Here's the controller

Dimo
Telerik team
 answered on 10 Feb 2016
6 answers
208 views

Hello,

We are trying to replicate this style of chart:  https://www.amcharts.com/demos/stacked-bar-chart-with-negative-values/  

Is it possible to accomplish this with Kendo UI?

We don't need two bars on the same line, but we would have a bar that extends into either a postive or negative x-axis with a 0 starting point. The positive/negative would represent a series (such as male/female) in the above example.   We would also want to show the labels of the Value axis on the outside end of the bar, and the value label on the inside end (such as showing the "age" category label next to the bar, with the value inside the bar with above example).

 

Thanks.

 

Joe
Top achievements
Rank 1
 answered on 09 Feb 2016
3 answers
124 views

Hello,

 I have a strange behavior of the scheduler widget.  It doesn't display correctly ( see pic attached).

It used to work before. I've checked all the css and js reference. Everything seems ok. I don't know where to look.

Anybody have a clue?

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 09 Feb 2016
3 answers
159 views
Hi,

I'm considering buying Kendo UI for a project. In the first part of the project I only need the Excel and PDF generation stuff from Kendo UI and later on I need the charts too. Then I saw that Kendo UI Core includes the Excel and PDF stuff (https://github.com/telerik/kendo-ui-core) and therefore I think I'll start by using just Kendo UI Core.

But I can't find the Workbook and drawDOM stuff anywhere in the Kendo UI Core I've downloaded using Bower. I've downloaded the full trail of Kendo UI Professional and it includes files like kendo.excel.min.js and kendo.pdf.min.js which I can't find anywhere in the Core version. Where can I find the Excel and PDF stuff in Kendo UI Core?

Thanks, Niels
Dimiter Madjarov
Telerik team
 answered on 09 Feb 2016
1 answer
309 views
Lets say I have a list of 1000 items and I am trying to navigate through the grid using keyboard arrows UP/DOWN.When I reach the last item on the page and use keyboard DOWN arrow doesn't load the next items in the grid nor the UP arrow loads the previous data.
<!DOCTYPE html>
<html>
<head>
    <style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style>
    <title></title>
    <link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.1.112/styles/kendo.common-material.min.css" />
    <link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.1.112/styles/kendo.material.min.css" />
 
    <script src="//kendo.cdn.telerik.com/2016.1.112/js/jquery.min.js"></script>
    <script src="//kendo.cdn.telerik.com/2016.1.112/js/kendo.all.min.js"></script>
</head>
<body>
        <script src="../content/shared/js/people.js"></script>
 
        <div id="example">
 
            <div id="grid"></div>
 
            <script>
                $(document).ready(function() {
                    $("#grid").kendoGrid({
                        dataSource: {
                            data: createRandomData(50),
                            group: [{ field: "FirstName" }],
                            pageSize: 5,
                            schema: {
                                model: {
                                    id: "Id",
                                    fields: {
                                        FirstName: { type: "string" },
                                        LastName: { type: "string" },
                                        City: { type: "string" },
                                        Age: { type: "number" },
                                        BirthDate: { type: "date" }
                                    }
                                }
                            }
                        },
                        selectable: "multiple cell",
                        navigatable: true,
                        filterable: true,
                        sortable: true,
                        pageable: true,
            scrollable: {
               virtual: true
           },
                        columns: [ {
                                field: "FirstName",
                                width: 120,
                                title: "First Name"
                            } , {
                                field: "LastName",
                                width: 120,
                                title: "Last Name"
                            } , {
                                width: 120,
                                field: "City"
                            } , {
                                field: "BirthDate",
                                title: "Birth Date",
                                template: '#= kendo.toString(BirthDate,"dd MMMM yyyy") #'
                            } , {
                                width: 80,
                                field: "Age"
                            }
                        ]
                    });
 
                    $(document.body).keydown(function(e) {
                        if (e.altKey && e.keyCode == 87) {
                            $("#grid").data("kendoGrid").table.focus();
                        }
                    });
                });
            </script>
 
            <div class="box wide">
                <div class="box-col">
                <h4>Focus</h4>
                <ul class="keyboard-legend" style="margin-bottom: 1em;">
                    <li>
                        <span class="button-preview">
                            <span class="key-button leftAlign">Alt</span>
                            +
                            <span class="key-button">w</span>
                        </span>
                        <span class="button-descr">
                            focuses the widget
                        </span>
                    </li>
                </ul>
 
                <h4>Actions applied on Grid header</h4>
                <ul class="keyboard-legend">
                    <li>
                        <span class="button-preview">
                            <span class="key-button">Enter</span>
                        </span>
                        <span class="button-descr">
                            sort by the column
                        </span>
                    </li>
                    <li>
                        <span class="button-preview">
                            <span class="key-button leftAlign">Alt</span>
                            +
                            <span class="key-button">Down</span>
                        </span>
                        <span class="button-descr">
                            opens the filter menu
                        </span>
                    </li>
                    <li>
                        <span class="button-preview">
                            <span class="key-button">Esc</span>
                        </span>
                        <span class="button-descr">
                            closes the filter menu
                        </span>
                    </li>
                    <li>
                        <span class="button-preview">
                            <span class="key-button">Tab</span>
                        </span>
                        <span class="button-descr">
                            navigates through the elements in the filter menu(default browser behavior)
                        </span>
                    </li>
                    <li>
                        <span class="button-preview">
                            <span class="key-button leftAlign">Shift</span>
                            +
                            <span class="key-button">Tab</span>
                        </span>
                        <span class="button-descr">
                            same as Tab, but in reverse order
                        </span>
                    </li>
                </ul>
                </div>
 
                <div class="box-col">
                <h4>Actions applied on Grid data table</h4>
                <ul class="keyboard-legend">
                    <li>
                        <span class="button-preview">
                            <span class="key-button wider">Arrow Keys</span>
                        </span>
                        <span class="button-descr">
                            to navigate over the cells
                        </span>
                    </li>
                    <li>
                        <span class="button-preview">
                            <span class="key-button">Enter</span>
                        </span>
                        <span class="button-descr">
                            on group row will toggle expand/collapse
                        </span>
                    </li>
                    <li>
                        <span class="button-preview">
                            <span class="key-button wider">Page Up</span>
                        </span>
                        <span class="button-descr">
                            pages on previouse page
                        </span>
                    </li>
                    <li>
                        <span class="button-preview">
                            <span class="key-button wider">Page Down</span>
                        </span>
                        <span class="button-descr">
                            pages on next page
                        </span>
                    </li>
                    <li>
                        <span class="button-preview">
                            <span class="key-button">Space</span>
                        </span>
                        <span class="button-descr">
                            selects currently highlighted cell
                        </span>
                    </li>
                    <li>
                        <span class="button-preview">
                            <span class="key-button leftAlign">Ctrl</span>
                            +
                            <span class="key-button">Space</span>
                        </span>
                        <span class="button-descr">
                            same as Space, but perists previously selected cells(only for selection mode "multiple")
                        </span>
                    </li>
                </ul>
                </div>
            </div>
        </div>
 
</body>
</html>
Thanks
Boyan Dimitrov
Telerik team
 answered on 09 Feb 2016
2 answers
223 views

I have a Kendo grid with inline editing. When I edit a row, and then click update, the changes show, but then when I edit the same row again and then click cancel, all the changes are removed, including the first edit. How can I make the data save after each 'Update'?

 Also can someone explain the difference between update:{} and save:{}? Thanks.

Andy
Top achievements
Rank 1
 answered on 09 Feb 2016
2 answers
344 views
I have a grid that uses detailInit, right now I am able to change color of the row to blue when the row's given ID is equal to 0, its at this point that I need to hide the detail indicator as well, I have tried a few different things but haven't been able to successfully remove the indicator. Here is the code for my grid, and you can see where I am adding the color blue to the row and I have a comment there where I am trying to remove the detail indicator

$("#CatalogGrid").kendoGrid({
        dataSource: {
            data: catalogData
        },
        schema: {
            model: {
                id: "globalGroupID",
            }
        },

        columns: [
           { field: "globalGroupLevel", title: "globalGroupLevel", hidden: true },
           { field: "globalGroupName", title: "Group Name", width: 350 },
           { field: "isRequired", title: "*", width: 20 },
           { field: "optionName", title: "Option Name" },
           { title: "Description" },
           { title: "Price" }
        ],

        change: function (e) {
            onSelectedRowClick();
        },
        scrollable: true,
        pageable: false,
        selectable: "row",
        height: 500,
        dataBound: function (e) {
            var data = this.dataSource.data();

            $.each(data, function (i, row) {
                if (row.get("globalGroupLevel") == 0) {
                    var element = $('tr[data-uid="' + row.uid + '"] ');
                    element.addClass("colored-row");
// Trying to remove detail indicator when globalGroupID is equal to 0
                    element.removeClass("k-icon k-minus");
                }
            });

        },
        detailInit: detailInit,
        detailExpand: function (e) {
            groupID = this.dataItem(e.masterRow).get("globalGroupID");
        },
    });
}
var groupID;

function detailInit(e) {
    var masterRow = e.masterRow;
    var globalID = e.data.globalGroupID;

    $("<div/>").appendTo(e.detailCell).kendoGrid({
        dataSource: {
            transport: {
                read: URLParams.GetTheGlobalGroupOptions + "?id=" + e.data.globalGroupID + "&sectionid=" + isThereASectionID
            },
        },
        scrollable: false,
        selectable: "row",
        filterable: "row",
        filter: { field: "globalGroupID", operator: "eq", value: e.data.globalGroupID },
        change: function (e) {

            // get detail row
            var detailRow = this.dataItem(this.select());
            var optionName = detailRow.get("OptionName") // Change this stuff to populate into the correct columns
            var optionID = detailRow.get("OptionID");

            $("#CatalogGrid").getKendoGrid().dataItem(masterRow).set("optionName", optionName);

            ShowAndHideGroups(0);

            ProcessGlobalOption(optionID, globalID);

            //ShowAndHideGroups(0);
        },
        columns: [
            { field: "OptionID", title: "Option ID", hidden: true },
            {
                field: "OptionName", title: "Option Name", filterable: {
                    cell: {
                        showOperators: false,
                        operator: "contains"
                    }
                }
            },
            { field: "OptionDescription", title: "Description" },
            { field: "OptionPriceComment", title: "Price" }
        ]
    });
}
Chris
Top achievements
Rank 1
 answered on 09 Feb 2016
6 answers
134 views

I have a Kendo UI map working great in Chrome, Firefox, and Safari, but not Internet Explorer 11.  There are 3 layers being loaded: a "tile" layer from opencyclemap for the background images, a "shape" layer via geoJSON file of the world countries, and a "marker" layer.  The strange thing is that the "tile" layer and the "marker" layer load fine, but the geoJSON "shape" layer never loads, and the "shapeCreated" event never fires.  This event fires fine on other browsers.  Is there something I can look for in order to debug what I've messed up on in the Kendo UI framework?  I just tested the example maps you have in the same IE browsers and the geoJSON maps work fine, so I'm thinking it's something that I'm doing wrong with the loaded data?

 This is the same file/map as a previous post but a different problem.

001.var colors = ['#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#08519c', '#08306b'];
002. 
003.// create the map with the markers
004.$("#kendoMapCounty").kendoMap({
005.    center: [38.891033, -95.437500],//[30.268107, -155.744821],
006.    zoom: 4,
007.    controls: {
008.        attribution: false,
009.        navigator: false
010.    },
011.    wraparound: false,
012.    layers: [
013.        {
014.            type: "tile",
015.            urlTemplate: "http://#= subdomain #.tile2.opencyclemap.org/transport/#= zoom #/#= x #/#= y #.png",
016.            subdomains: ["a", "b", "c"],
017.            attribution: "© <a href='http://osm.org/copyright'>OpenStreetMap contributors</a>." +
018.            "Tiles courtesy of <a href='http://www.opencyclemap.org/'>Andy Allan</a>"
019.        },
020.        {
021.            type: "shape",
022.            dataSource: {
023.                type: "geojson",
024.                transport: {
025.                    read: "/Resources/kendoui/GeoJSON/countries_and_counties.geo.json"
026.                }
027.            }
028.        },
029.        {
030.            type: "marker",
031.            dataSource: SL.kendoMapMarkers,
032.            locationField: "latlng",
033.            titleField: "name"
034.        },
035.    ],
036.    shapeCreated: function (e) {
037.        var dataItem = e.shape.dataItem;
038.        var id = dataItem.properties.GEOID10;
039.        if (typeof id !== "undefined") {
040.            SL.shapesById[id] = SL.shapesById[id] || [];
041.            SL.shapesById[id].push(e.shape);
042. 
043.            var STATEFP10 = parseInt(e.shape.dataItem.properties["STATEFP10"]);
044.            if (STATEFP10) {
045.                e.shape.fill(colors[STATEFP10 % colors.length]);
046.                e.shape.options.set("fill.opacity", 0.0);
047.            }
048. 
049.            if (SL.selectedLocationIDs.length > 0) {
050.                $.each(SL.selectedLocationIDs, function (key, mapId) {
051.                    if (mapId === id.toString()) {
052.                        e.shape.options.set("fill.opacity", 0.8);
053.                        SL.selectedCounties.push(e.shape);
054.                    }
055.                });
056.            }
057.        }
058. 
059.        id = dataItem.properties.iso_a3;
060.        if (typeof id !== "undefined") {
061.            var diss_me_id = dataItem.properties.diss_me;
062.            SL.shapesById[id] = SL.shapesById[id] || [];
063.            SL.shapesById[id].push(e.shape);
064. 
065.            var typeCode = e.shape.dataItem.properties["type"];
066.            if (typeCode === 'State') {
067.                var diss_me = parseInt(e.shape.dataItem.properties["diss_me"]);
068.                if (diss_me) {
069.                    e.shape.fill(colors[diss_me % colors.length]);
070.                    e.shape.options.set("fill.opacity", 0.0);
071.                }
072.            }
073.            else {
074.                var iso_n3 = parseInt(e.shape.dataItem.properties["iso_n3"]);
075.                if (iso_n3) {
076.                    e.shape.fill(colors[iso_n3 % colors.length]);
077.                    e.shape.options.set("fill.opacity", 0.0);
078.                }
079.            }
080. 
081.            if (SL.selectedLocationIDs.length > 0) {
082.                $.each(SL.selectedLocationIDs, function (key, mapId) {
083.                    if (typeCode === 'State') {
084.                        if (mapId === diss_me_id.toString()) {
085.                            e.shape.options.set("fill.opacity", 0.8);
086.                            SL.selectedCounties.push(e.shape);
087.                        }
088.                    }
089.                    else {
090.                        //var DBCode = SL.getDBCodeFromMapId(mapId);
091.                        if (mapId === id) {
092.                            e.shape.options.set("fill.opacity", 0.8);
093.                            SL.selectedCounties.push(e.shape);
094.                        }
095.                    }
096.                });
097.            }
098.        }
099.    },
100.    click: SL.onClick,
101.    reset: SL.onReset,
102.    pan: SL.onPan,
103.    panEnd: SL.onPanEnd,
104.    shapeClick: SL.onShapeClick,
105.    shapeMouseEnter: SL.onShapeMouseEnter,
106.    shapeMouseLeave: SL.onShapeMouseLeave,
107.    zoomStart: SL.onZoomStart,
108.    zoomEnd: SL.onZoomEnd
109.});

T. Tsonev
Telerik team
 answered on 09 Feb 2016
3 answers
706 views

Having issues recreating the demo example of importing a spreadsheet.  The demo references a saveUrl and I cannot determine what that is used for.

In addition, I tried the Dojo example of the fromFile method and could not get it to work.  When I select a file, nothing happens.  Is the change event not getting fired?

I am using Chrome as my browser.  Any help would be appreciated.  Basically trying to load a simple Excel file into the spreadsheet widget.

 

Thanks, Rick

T. Tsonev
Telerik team
 answered on 09 Feb 2016
3 answers
240 views

Hi,

Please help me to get my templates which I load in MVVM in different tabs fine, until I load tabs and their respective content divs dynamically using tabStrip.

I should be able to load separate templates with in tabs but I am not sure how to go about it pulling from remote JSON.

Please have a look at the link below. I've tried to add my data as arrays in the project they are all remote JSON files.

The example

I would appropriate if you could show me in the example how can I load different templates with different datasource in different tabs. In the example I am using tabsDataSource and tileDataSource.

Thanks.

Savas

Dimo
Telerik team
 answered on 09 Feb 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
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
ScrollView
Switch
TextArea
BulletChart
Licensing
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?