Telerik Forums
Kendo UI for jQuery Forum
13 answers
663 views

I have a grid I'd like to populate that uses a viewmodel that has a datasource with a REST url that has parameters for filtering the data.  I'm trying to set the url parameters, but I'm unable to get at them from the nested datasource.

How can I make the nestd url dynamically reflect the changes in the parent observable?  My viewmodel is below, and any help is appreciated!

Thanks, Dennis

var viewModel = kendo.observable({
    artistFilter: "",
    titleFilter: "",
    genderFilter: "",
    artistFilterUrl: function () {
        if (this.get("artistFilter") == "") {
            return "";
        }
        return "&artist=" + this.get("artistFilter");
    },
    titleFilterUrl: function () {
        if (this.get("titleFilter") == "") {
            return "";
        }
        return "&title=" + this.get("titleFilter");
    },
    Url: function () {
        return this.get("baseUrl") + this.artistFilterUrl() + this.titleFilterUrl();
    },
    gridSource: new kendo.data.DataSource({
        transport: {
            read: {
                url: function () { return viewModel.Url() }, // this is where I'm having trouble
                dataType: "jsonp",
                async: false
            }
        },
        schema: {
            data: "songs",
            total: "count",
            model: {
                fields: {
                    Artist: { type: "string" },
                    Title: { type: "string" },
                    Category: { type: "string" },
                    Gender: { type: "string" },
                    CatalogNumber: { type: "string" }
                }
            }
        },
        page: 1,
        pageSize: 50,
        serverPaging: true,
        serverFiltering: true,
        serverSorting: true
    })
});
Kevin
Top achievements
Rank 1
 answered on 28 Mar 2014
12 answers
914 views
How can I bind a select element to a kendo.data.DataSource? I know a select element can bind to an array of JavaScript objects but I would like to use the kendo.data.DataSource instead. I've been following the example in the demo here although it doesn't use a DataSource.

The error message I get in the console of the simulator is "Uncaught ReferenceError: DEP_ID is not defined"

Some example code, that shows what I'm trying to do and returns the above error, is below. Note that I am using Graphite and have included the SQLite plugin in my project.

<div data-role="view" id="tabstrip-Employees" data-title="Employees" data-model="employeeVM">
    Department
    <select data-bind="source: departmentSource"
        data-value-field="DEP_ID" data-text-field="DEP_Name">
    </select>
</div>

var employeeVM = kendo.observable({
    departmentSource: new kendo.data.DataSource({
        transport: {
            read: function(options){
                data.db.transaction(function(tx) {
                    tx.executeSql("SELECT DEP_ID, DEP_Name FROM Department", [], 
                        function (tx, rs) {
                            options.success(data.toArray(rs));
                        }, 
                        data.onError);
                });
            }
        }
    });
});

var data = {
    db: null,
    
    init: function() {
        data.openDb();
        data.createTables();
    },
    
    openDb: function() {
        if(window.sqlitePlugin !== undefined) {
            data.db = window.sqlitePlugin.openDatabase("SuperStore");
        } else {
            // For debugging in simulator fallback to native SQL Lite
            console.log("Use built in SQL Lite");
            data.db = window.openDatabase("SuperStore", "1.0", "SuperStore", 200000);
        }
    },
    
    createTables: function() {
        data.db.transaction(function(tx) {
            tx.executeSql("CREATE TABLE IF NOT EXISTS [Department]( \
                [DEP_ID] INTEGER PRIMARY KEY ASC, \
                [DEP_Name] TEXT NULL \
            )", []);
            tx.executeSql("DELETE FROM Department");
            tx.executeSql("INSERT INTO Department(DEP_ID, DEP_Name) VALUES (?,?)",
                [1, "Department 1"]);
            tx.executeSql("INSERT INTO Department(DEP_ID, DEP_Name) VALUES (?,?)",
                [2, "Department 2"]);
            tx.executeSql("INSERT INTO Department(DEP_ID, DEP_Name) VALUES (?,?)",
                [3, "Department 3"]);
        }, data.onError);
    },
    
    toArray: function(result) {
        var length = result.rows.length;
        var data = new Array(length);
        for (var i = 0; i < length; i++) {
            data[i] = result.rows.item(i);
        }
        return data;
    },
    
    onError: function(tx, e) {
        if(e !== undefined){
            console.log("Error: " + e.message);
        }
        else if(tx !== undefined){
            console.log("Error: " + tx.message);
        }
    }    
};

// Wait for PhoneGap to load
document.addEventListener("deviceready", onDeviceReady, false);

// PhoneGap is ready
function onDeviceReady() {
    data.init()
    window.app = new kendo.mobile.Application(document.body, { transition: "slide", layout: "mobile-tabstrip", initial: "#tabstrip-Employees" });
    navigator.splashscreen.hide();
}



Alexander Valchev
Telerik team
 answered on 28 Mar 2014
1 answer
223 views
Dear Support Team,

My Company bought Kendo UI Complete version. What I would like to do is, I want to create as Kendo UI Mobile Project and want to have default template for mobile from Kendo UI at the Visual Studio 2012 new Project Dialog. How can I install Kendo UI to Visual Studio 2012?

I also install ICENIUM demo version. With this, I can see project Template at the Visual Studio. Please let me know without using ICENIUM, is there a way to get project template if I only have kendo UI complete.


Thanks & Regards,
UFIS
Sebastian
Telerik team
 answered on 28 Mar 2014
5 answers
746 views
Hi,

How can we know that the selected TreeView Node is having the Child Nodes or Not.

Help is required on this.

Regards,
Satish.N
Dimiter Madjarov
Telerik team
 answered on 28 Mar 2014
1 answer
101 views
I have a stock chart, and when zoomed with the mouse wheel it goes deeper and deeper, all the way to hours and minutes.

I want to have the zoom limited to seven days. 

Is this possible?
Iliana Dyankova
Telerik team
 answered on 28 Mar 2014
1 answer
200 views
Hi

How can i disable the loading animation while remote view is loading? Why?

because some times the loading animation is frozen. I think that is because HTML apps are single thread.

Also i've used the app.showLoading while i use ajax to get data for a chart but the animation always is frozen.

I love Kendo UI! but i want to use spin.js instead. Sorry but when i use ajax with spin.js, the spinner animation run very smooth

please advise.

Irina
Kiril Nikolov
Telerik team
 answered on 28 Mar 2014
1 answer
164 views
Notifications are overlapping in IE11. This can be repoduced with the Kendo demo:  http://demos.telerik.com/kendo-ui/web/notification/index.html

Latest Chrome and Firefox are OK.

Thanks
Holger
Dimo
Telerik team
 answered on 28 Mar 2014
1 answer
126 views
Hello,

I have a kendo grid that has template columns with "select" button. All this works fine. now when the user clicks that select I want the id to be passed into another page that has 2 controls : a kendo grid(populated from the database according to the id supplied) and another say listbox(with 4 fields also populated from the database according to the id supplied )

How do I get both controls populated with data?
click "select"--> populate grid and list/table

Can you give me a sample for what I am trying to do?
Dimiter Madjarov
Telerik team
 answered on 28 Mar 2014
2 answers
93 views
I have a modelview made with this code: 
<div data-role="modalview" id="windowPopup" data-modal="false" data-close="closeFunction"> 
<ul data-role="listview" data-style="inset" data-type="group"> 
<li>
.....
</li>
</ul>
</div> 

The function closeFunction () is never started. 
This is because data-modal false? Is there a solution? 

I've tried using the data event-open and it works well. 

I tried with 2014.1 318 and 2013 versions.
Kiril Nikolov
Telerik team
 answered on 28 Mar 2014
6 answers
306 views
Hello,

i have a ASP .NET MVC app for Desktop and mobile devices. I have downloaded Kendo ui for asp net MVC and included folowing code in my _Layout.cshtml and _Layout.Tablet.cshtml.
@Styles.Render("~/Content/kendo/css")
<link rel="stylesheet" href="http://cdn.kendostatic.com/2013.3.1324.440/styles/kendo.common.min.css" />
<link rel="stylesheet" href="http://cdn.kendostatic.com/2013.3.1324.440/styles/kendo.default.min.css" />
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/kendo")
<script src="http://cdn.kendostatic.com/2013.3.1324.440/js/kendo.all.min.js"></script>
<script src="http://cdn.kendostatic.com/2013.3.1324.440/js/kendo.aspnetmvc.min.js"></script>
The Desktop browser can run the grid and Display data invoking read.action method in Controller. But when i run app on tablet (ipad or android) does not matter which browser it cannot load the grid and just see wait Cursor. When i debug seems it calls Index method in Controller but no read Action method.
Kiril Nikolov
Telerik team
 answered on 28 Mar 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
Drag and Drop
Application
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
DropDownTree
ListBox
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
Styling
ColorPicker
Pager
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
Licensing
PivotGridV2
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
LLM Kit
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?