Telerik Forums
Kendo UI for jQuery Forum
6 answers
433 views
Hi,

Am new to kendo UI, so am not sure how I can do this task.

Problem: I have two data sources(Vtest.json file and Vdata.json file) that I want to populate in a single kendo grid. The grid is populated in such a way that the first three columns are populated from data.json file and the last column should be populated from Vtest.json file based on the first column in the grid. So I am trying to call a javascript function in the last column template in kendo grid. But am unable to filter the data and return the result to third column.

Here is the sample code:

 var vDS = new kendo.data.DataSource({
        transport: {
            read: {
                url: "/views/VTest.json",
                dataType: "json"
            }
        }
    });
    
    //alert(JSON.stringify(vendorDS));

 
    var nodeDS = new kendo.data.DataSource({
        transport: {
            read: {
                url: "/views/Vdata.json",
                dataType: "json"
            }
        },
        pageSize: 1000
    });

  $("#gridAllRuns").kendoGrid({
                    
                    dataSource: nodeDS,                    
                    groupable: true,
                    sortable: true,
                    pageable: {
                        refresh: true,
                        pageSizes: true,
                        buttonCount: 10
                    },
                    filterable: {
                        extra: false,
                        operators: {
                            string: {
                                startswith: "Starts with",
                                eq: "Is equal to",
                                neq: "Is not equal to"
                            }
                        }
                    },
                  
                    columns: [
                        {
                            title: "Node name",
                            field: "location",
                            template: "<a href=\"\">#= location.substr(7, location.length)#</a> ",
                            filterable: true
                            },
                              {
                                  title: "UTC Date",
                                  field: "date_UTC",
                                  filterable: false
                              },
                              {
                                  title: "Actual Value",
                                  field: "wavg_bin_value1",
                                  filterable: false
                              },
                          
                              {
                                  title: "Vendor",
                                  field: "",
                                  template: "#= getVendor(location) #",
                                  filterable: true
                              }
                            
                    ]
                })
//my javascript function....
  function getVendor(location) {
        var node = location.substr(7, location.length);
       vDS.filter({ field: "node", operator: "eq", value: node });
       return vDS.view()[0].Vndr;
}



Petur Subev
Telerik team
 answered on 11 Apr 2014
1 answer
132 views
Hello Kendo team:
If you change the value of a cell in a locked column, its k-dirty span is not shown.
Please, see this example : http://trykendoui.telerik.com/ubaP
and change the  ProductName of a row.

Kind regards.
Oscar
Nikolay Rusev
Telerik team
 answered on 11 Apr 2014
1 answer
123 views
Is there a way to make kendo.observable set up non enumerable properties from the object you give it?  For example:

var someObject = {};
someObject.x = 5;
Object.defineProperty(someObject, "someString", {
    enumerable: false,
    configurable: false,
    writable: true
});
someObject.someString = "This is the base";
 
var foo = kendo.observable(someObject)
 
"x" in foo;  //true
"someString" in someObject;  //true
"someString" in foo;  //false, but I want this to be true
Petyo
Telerik team
 answered on 11 Apr 2014
2 answers
114 views
I am putting this thread here because the issue is in the datasource and not in the dropdownbox.

I have a screen with a dropdownbox and a grid.  The grid has data passed to it in the model and creates a datasource to load those values.  The dropdownbox uses a URL to call the controller to retrieve values remotely.  When the screen is loaded, the items in the list all have the correct description (the relevant text and id options are set on the drop down), but the selected item just reads '[object object]'.

This is where it gets odd.  If I remove the grid and change nothing else, the drop down works correctly.  All options being passed into the drop down and the datasource are identical in every way in both situations.

I have switched to the non minified script and stepped through.  When I have the grid I reach L105 of kendo.data.js (wrapAll) and:

target[0] instanceof ObservableObject returns true, but

target[0] instanceof kendo.data.ObservableObject returns false.

ObservableObject and kendo.data.ObservableObject are references to the exact same definition, so how is this even possible?  This false result then causes the drop down box code to display the selected item the way it does.

I have been unable to replicate this issue in the Kendo dojo so I realise it will probably be hard for you to offer any help, but can you think of anything which might cause this?

All parameters are identical, the grid on the screen is the only difference.  It still happens if I remove the datasource from the grid so it's not even two datasources clashing.

I will continue trying to recreate this outside of my system (its a complex project so I cannot post it as an example).
Karl
Top achievements
Rank 1
 answered on 11 Apr 2014
4 answers
176 views
Hello,

I have a little issue using the Grid control (MVC). All works fine except for one small problem. The filter window doesnt appear when you click the filter option on the grid header.

I can see in the source that window is being shown, the only problem is it's top value is -1000px. If I manually adjust this to 0px then the window appears at the top of the window (as you would imaging).

<div class="k-animation-container" style="margin-left: -2px; padding-left: 2px; padding-right: 2px; padding-bottom: 4px; overflow: visible; display: block; position: absolute; top: -10000px; z-index: 10002; left: 502.40625px; box-sizing: content-box;">
//omitted container showing filter form.
 
</div>

Has anyone come across this before and possibly have a fix in place?

From what I can tell the correct kendo & jQuery files are referenced.

bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
                        "~/Scripts/kendo/kendo.all.min.js",
                        "~/Scripts/kendo/kendo.aspnetmvc.min.js"));
 
            bundles.Add(new StyleBundle("~/Content/kendo/css").Include(
                        "~/Content/kendo/kendo.common.min.css",
                        "~/Content/kendo/kendo.default.min.css"));

jquery version 1.8.3, I cant upgrade any higher than that at the moment as it breaks alot of other scripts on the site.

Cheers,

Nico
Darshan
Top achievements
Rank 1
 answered on 11 Apr 2014
1 answer
1.1K+ views
Hi

I have defined a multiselect element in my page. The I am trying to get the value of select items using javascript. When the .Value line is executed on the frontend a duplicate element is created.

The pre and post image is attached.

Please help

Regards,
Sanjay
Definition
@(Html.Kendo().MultiSelectFor(m => m.SeleFromAvail)                           
    .Name("seleLst")
       .Placeholder("Select")
       .HtmlAttributes(new { id = "seleLst", style = "width:940px;" })                           
       .BindTo((List<SelectListItem>)ViewBag.lstAvail)
       .Value((List<SelectListItem>)ViewBag.lstSele)
       .AutoClose(false)
       )
Javascript       
param = $("# seleLst ").kendoMultiSelect().data("kendoMultiSelect").value();
Georgi Krustev
Telerik team
 answered on 11 Apr 2014
3 answers
165 views
Hey I've noticed that with the kendoUI datepicker when initialized outputs the container div and calendar at the end of the HTML body.  I would like to be able to control where this content is appended to the DOM.

The main reason is because I am using this picker on a Bootstrap dropdown that closes on document click, my custom javascript prevents the dropdown from closing if a click is made on any element within that particular dropdown, however since the DatePicker is rendered outside of that div at the end of the BODY tag, choosing a date closes both the datepicker and the dropdown.

Any ideas?
Georgi Krustev
Telerik team
 answered on 11 Apr 2014
3 answers
1.3K+ views
Hello,

In the following code, I would like to bind some data (to display it)... but is some case, I need to change the value of some component by code (in JavaScript). In this case, the ViewModel is not updated (by a "two way" binding). Why ?

HTML
    <input type="button" id="btnChangeValues" value="Change Values" /><br/><br />
    <input id="myNumeric" data-bind="value: MyNumeric" /> 
    <input id="myDate" data-bind="value: MyDate" />   

JavaScript
   window.onload = function() {

    var viewModel = kendo.observable({ MyNumeric: 123, MyDate: new Date(2014, 1, 15) });

    $("#myNumeric").kendoNumericTextBox();
    $("#myDate").kendoDatePicker();
    kendo.bind(document.body, viewModel);

    $("#btnChangeValues").click(function() {
        $("#myNumeric").data("kendoNumericTextBox").value(789);
        $("#myDate").data("kendoDatePicker").value(new Date(2015, 3, 28));
        alert(viewModel.get("MyNumeric") + " - " + viewModel.get("MyDate"));   // Display always OLD values: 123 and 2014-2-15
    });

   };


Can you tell me how to force a "ViewModel Refreshing" ? Is it possible ?

Thanks

Denis
Georgi Krustev
Telerik team
 answered on 11 Apr 2014
1 answer
4.7K+ views
We have a grid with editing mode set to inline edit. The grid autoSync is set to false. User make changes to grid, and on clicking a save button (which is outside the grid), edited grid rows are saved to server. Grid row has a textbox, dropdown box and combobox as input field. Each row also have validation status icon in the last column. If user has not entered any value in textbox, or not selected any value in dropdown box or combobox , validation icon for that row is shown. On hover over the validation icon, corresponding errors for that row are shown to user. If user has selected all valid value, validation icon is not shown, indicating everything is correct.

We are currently doing validation on complete grid and refresh grid to show the icon for row with error. This validation is done every time user insert/update input field value. Can you suggest us the best way to do this? Is there a way, like on changing the row input field value, only row should be refreshed and validation icon should show/not show based on validation status.
Petur Subev
Telerik team
 answered on 11 Apr 2014
2 answers
220 views
Our DropDown lists are appearing on the far left side of the screen when the zoom is changed from 100%.

This happens only in Chrome that we've noticed, and seems it might be related to either or both of a Chrome bug, or a jQuery bug.

My question is: does anyone have a workaround for this that they can share?
Travis
Top achievements
Rank 1
 answered on 10 Apr 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?