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

Hi,

I have the following code for my grid that contains a dropdownlist column.  On the change of the dropdown list, I call a controller function via ajax to update my record in the DB.  The DB is updated correctly but as soon as I leave that row the value goes back to the old value in the dropdownlist.  The DB is still correct and if I refresh my screen is loads correctly.  

I've tried to do a datasource refresh, I've tried to get the datasource again and do a setDataSource.  Nothing refreshes the grid and retrieves the data.  My code is below for the grid and the dropdownlist.

Any suggestions?  Thank you in advance Admin for your help.

 

//GRID

$("#grid").kendoGrid({
        dataSource: {
            type: "json",
            transport: {
                read: "Grid/Ratings_Read",
                cache: false
            },
            schema: {
                model: {
                    fields: {
                        ProductSkill: { type: "string" },
                        RateID: { type: "int" },
                        RateValue: { type: "int", defaultValue: { RateID: 1} },
                        ItemCategoryName: { type: "string", title: "Category" },
                        GroupName: { type: "string", title: "Group", }
                    }
                }
            },
            pageSize: 20,
            batch: false,
            group: [
                {
                    field: "GroupName", dir: "asc"
                },
                {
                    field: "ItemCategoryName", dir: "asc"
                }
            ]
        },
        height: 550,
        filterable: true,
        selectable: true,
        sortable: true,
        pageable: true,
        columns: [{
            field: "ProductSkill",
            title: "Skill",
            //format: "{0:MM/dd/yyyy}"
        }, {
            field: "RateID",
            title: "RateID",
            hidden: "true"
        }, {
            field: "RateValue",
            title: "Rating",
            editor: ratingDropDownEditor, template: "#=RateDisplay#"
        }, {
            field: "RateAssocID",
            title: "RateAssocID",
            hidden: "true"
        }, {
            field: "ItemID",
            title: "ItemID",
            hidden: "true"
        }
        ],
        editable: true,
        change:  onRowChange

    });

//END GRID

 

//DROPDOWNLIST

function ratingDropDownEditor(container, options) {
        $('<input required name="' + options.field + '"/>')
            .appendTo(container)
            .kendoDropDownList({
                autoBind: false,
                dataTextField: "RateDisplay",
                dataValueField: "RateID",
                dataSource: {
                    type: "json",
                    transport: {
                        read: "Grid/Rate_Read"
                    }
                },
                change: onDropDownChange
            });
    }

    function onDropDownChange(e) {
        list = e.sender;
        var currentListSelected = list.dataItem(this.select());

        $.ajax({
            url: "Grid/Rating_InsertUpdate?rateAssocID=" + currentRateItem.RateAssocID + "&itemID=" + currentRateItem.ItemID + "&rateID=" + currentListSelected.RateID, success: function (result) {
                //alert(result);
                
            }
        });
    }

//END DROPDOWNLIST

Viktor Tachev
Telerik team
 answered on 30 Oct 2018
3 answers
384 views

Hi,

When I add a window with a draggable containment that changes with browser resizing the kendo window is limited to the containment elements original browser size.

1. run the example with a small browser window.

2. resize the browser to make it bigger.

3. try to resize the kendo window to make it bigger, it will not get bigger than the original containment size.

https://dojo.telerik.com/axuRUkiq/3

Is there an initialization function that I can call to reset the containment? I can kind of fix it by setting the maxHeight, maxWidth options on the window resize.

Thanks.

Ivan Danchev
Telerik team
 answered on 30 Oct 2018
2 answers
852 views
I am trying to load the culture files(kendo.messages.xx-xx.min.js) from the local disk, is there a good way to do that?

The method you provided is like following:
var baseUrl = 'https://kendo.cdn.telerik.com/2018.3.1017/js/messages/kendo.messages.';
$.getScript(baseUrl + "zh-CN.min.js", function () {
kendo.ui.progress($("#grid"), false);
CreateGrid();
});

I would like to load it like following, but it didn't work for me.
$.getScript("../culture/zh-CN.min.js", function () {
kendo.ui.progress($("#grid"), false);
CreateGrid();
});
Nick
Top achievements
Rank 1
 answered on 30 Oct 2018
10 answers
332 views

I have an application with a grid where the delete button is an icon and a tooltip has to be associated with it.

jQuery("#childrenGrid").kendoTooltip({"filter":".k-grid-delete","content":"Delete"}

The grid is with remote data and the tooltip does not show. If the grid uses not remote data the tooltip appears.

Can I make this work?

Ivan Danchev
Telerik team
 answered on 30 Oct 2018
4 answers
380 views

Dear All,

I am new to Kendo control, please help me with this, I already have Tree View as shown in the attachment, Now I have Expand onclick of button, I know the code to perform Expand, but it doesn't expand complete child nodes, instead it does just only 1 immediate child, if it has more child, we need to keep clicking the Expand button then it does the expand. Please help me how to achive on single click to Expand all the Parent and Child nodes.

Its not repatitive question, I have already searched here,Please help me.

This is My code:   
                  $("#expand").on("click", function(){
                    var treeview = $("#treeview").data("kendoTreeView");
                              treeview.expand(".k-item");
                    })

Kannan
Top achievements
Rank 1
 answered on 30 Oct 2018
4 answers
2.7K+ views

Hi

 

I have severals tabs on the tab strip, each ith its own grid.
When I build the grids from JS code I specify autobind = false.

On with my code, I'm doing a call to filter method on a grid to apply some filter when it loads
and a few lines afterward it calls to dataSource.read method.

When I check the network tab on the dev tools I see The current tab grid is calling twice to get the data,
and the other tabs grid call only once to fetch the data.

 

Why is this behavior?

Attached screenshots of the network tab showing what I mean.

If you need any more data let me know

 

Thanks

Shahar
Top achievements
Rank 1
 answered on 29 Oct 2018
2 answers
153 views

Hi,

Here is html generated for a DropDownList. As you can see, data are well populated.

However when I click on it, I just get "no data found". Maybe I miss something obvious, but I spent hours trying to fix it without success.

Thanks.

 

<select name="K_AGENCE"      id="clientK_AGENCE"      data-bind="value: selected.K_AGENCE,      disabled: isDisabled('dis')" data-role="dropdownlist" style="display: none;" class="k-valid">
<option value="A1">Agence 1</option>
<option value="A2">Agence 2</option>
<option value="A3">Agence 3</option>
<option value="A4">Agence 4</option>
</select>
ANDRE
Top achievements
Rank 1
 answered on 29 Oct 2018
4 answers
724 views

I found a similar thread for this but the solution is for ASP.Net and for a RadTreeView (https://www.telerik.com/forums/119788-multiple-context-menu-in-radtreeview).

How can i implement this using jQuery and a TreeView?

 

Thanks!

Ollie
Top achievements
Rank 1
Iron
 answered on 29 Oct 2018
2 answers
182 views

I am trying to load the culture files(kendo.messages.xx-xx.min.js) from the local disk, is there a good way to do that?

The method you provided is like following:

var baseUrl = 'https://kendo.cdn.telerik.com/2018.3.1017/js/messages/kendo.messages.';
$.getScript(baseUrl + "zh-CN.min.js", function () {
kendo.ui.progress($("#grid"), false);
CreateGrid();
});

 

I would like to load it like following, but it didn't work for me.

$.getScript("../culture/zh-CN.min.js", function () {
kendo.ui.progress($("#grid"), false);
CreateGrid();
});

Dimitar
Telerik team
 answered on 29 Oct 2018
2 answers
5.4K+ views

Hi,

I have used kendo grid for display of data, but I am getting an issue in databound event of the grid in dataItem.set() method, here property is not getting set for each row of the grid.

function ondataBound(e){
    var items = grid.items();
    items.each(function (index) {
        var dataItem = grid.dataItem(this);
        if (dataItem) {
            if (dataItem["ActionTaken"] == "Add"){
                if (rowChanges[dataItem.id]) {
                    for (key in rowChanges[dataItem.id]) {
                        dataItem.set(key, rowChanges[dataItem.id][key]);
                    }
                }
            }
        }   
    }
}

Thanks in advance.
Dipak

 

Dmitry
Top achievements
Rank 2
 answered on 29 Oct 2018
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?