Telerik Forums
Kendo UI for jQuery Forum
3 answers
691 views

Hi, I’ve been fighting this for a couple days so I thought I’d try to put the question out there. It kind of relates to a different earlier post but this is for remote data.  I’m using JQuery 1.8.2, kendoui.web.2012.3.1114 on IE9.

1.)     I’m trying to duplicate http://demos.kendoui.com/web/treeview/remote-data.html but I don’t understand how this works and populates on demand.  I’m trying to duplicate this with a WCF JSON response.   The only difference is that I’m not using JSONP since my service is local.  My WCF service returns the following.
 
d: "[{"FolderId":1,"FolderName":"Manufacturing","ParentFolderId":0,"UserId":30,"HasChildren":true}]"

 2.)    I’m testing getting the remote data 3 different ways below.  It binds to each treeview because it renders “Manufacturing” but the “HasChildren:true” doesn’t seem to have any effect on showing the arrow to expand.  Plus how would I populate on demand like #1 above?
 
3.)    What benefit does the transport object have over calling the $.ajax() method?

 My goal is to understand these enough so I can bind on demand OR load the entire treeview at once. 

//*-------------------------------------------------------------------------------
                
//  Remote HierarchicalDataSource demo using transport/parse
//*-------------------------------------------------------------------------------               

 var homogeneous = new kendo.data.HierarchicalDataSource({
 transport: {
 
read: {
 
url: "/Secure/WCF/MyService.svc/GetFolderList",
 
dataType: "json",
 
data: {
  
UserId: 30,
  
FolderId: 1
 
}
}
 },
schema: {
 
model: {
 
id: "FolderId",
 
hasChildren: "HasChildren"
},
 parse: function(data){
 
return preprocessData(data);
}
});

function preprocessData(data) {
 $("#treeviewTransportRemoteData").data("kendoTreeView").setDataSource(JSON.parse(data.d));
}

 $("#treeviewTransportRemoteData").kendoTreeView({
     dataSource: homogeneous,
    dataTextField: "FolderName"
}).data("kendoTreeView");

//*----------------------------------------------------------------------------
//  Remote data using JQuery Ajax method to populate remote data  
//*------------------------------------------------------------------------------                 

var params = new Object();
params.UserId = 30; 
params.FolderId = 1;             

 var jsonData = $.param(params);  
$.ajax({
  type: "GET",
  url: "/Secure/WCF/MyService.svc/GetFolderList",
  data: jsonData,
 
contentType: "application/json; charset=utf-8",
 
dataType: "json",
success: function (msg) {
 
$("#treeviewRemoteDataJQueryAjax").data("kendoTreeView").setDataSource(JSON.parse(msg.d));
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
  alert(textStatus);
  }
  });
});

 $("#treeviewRemoteDataJQueryAjax").kendoTreeView({
dataTextField: "FolderName"
}).data("kendoTreeView");

 //*-------------------------------------------------------------------------------
//  Remote data using JQuery Ajax inside transport read.
//*-------------------------------------------------------------------------------

 var hds =  new kendo.data.HierarchicalDataSource({

 transport: {
 
read: function(options) {
    v
ar params = new Object();
   
params.UserId = 30; 
   
params.FolderId = 1;
   
var jsonData = $.param(params);                          

         $.ajax({
   
type: "GET",
   
url: "/Secure/WCF/MyService.svc/GetFolderList",
    data: jsonData,
   
contentType: "application/json; charset=utf-8",
   
dataType: "json",
   
success: function (msg) {
     
$("#treeviewTransportJQueryAjax").data("kendoTreeView").setDataSource(JSON.parse(msg.d));
   
 },
   
error: function (XMLHttpRequest, textStatus, errorThrown) {
    
alert(textStatus);
   
}
 
 });
 }
},
 schema: {
  
model: {
    
id: "FolderId",
     
hasChildren: "HasChildren"
   }
}

 });

 $("#treeviewTransportJQueryAjax").kendoTreeView({
 
dataSource: hds,
 
dataTextField: "FolderName"}).data("kendoTreeView");

David
Top achievements
Rank 1
 answered on 12 Dec 2012
1 answer
1.3K+ views
Hi,

Can you give me work around for extending kendo combo box with checkbox and multiselect.

Thanks.
Iliana Dyankova
Telerik team
 answered on 12 Dec 2012
1 answer
511 views
Hi,
i am new to kendo-UI,i am using mvc3 architecture.i can able to bind values from database to ComboBox and as well as to grid. Right now i got one problem that when i'm selecting ComboBox, the selected value pass to database (which is from View to Model) get the data from database. would you please help me out ASAP. 
Jayesh Goyani
Top achievements
Rank 2
 answered on 12 Dec 2012
1 answer
90 views
Once a datasource is created, is it possible to change the grouping field in code?

I tried:

dataSource.options.group.field = "Name";

But it has no effect on the grid using the datasource.
Nikolay Rusev
Telerik team
 answered on 12 Dec 2012
1 answer
212 views
Given a viewmodel which contains an array of objects that have a boolean property (Selected), how should I set the background color of the ListView items dynamically.  I have tried to use the style binding which works fine when the ListView first loads but the ListView is not updated as the items "Selected" property change (on click).

Here is the fiddle.
Petyo
Telerik team
 answered on 12 Dec 2012
1 answer
44 views
Hey all,
VERY GREEN here with KendoUI!  I was looking for an example out there of how to use DataSource to connect to my SQL Server.  I'm relatively old school, and am used to using the ol' connection and recordset, then using a SQL statement - getting the results, and populating the combobox using a loop. I am a visual learner, so - I was wondering if anyone out there has a good example of how I can learn this transition?  I( have a ton of leghacy code, but intend to slowly make changes over to all KendoUI controls.  But - obviously - need to learn the basics....

Thank Youy in Advance!,
Chris
Georgi Krustev
Telerik team
 answered on 12 Dec 2012
1 answer
102 views
Hi

I'm not sure if this is possible...  I'd like the use the Image Editor to upload and manage a collection of images on a website.  The user can then select images to add to an image rotator for articles.  i.e. The images aren't embedded in text, but are displayed separately.

Thanks
Paul
Petur Subev
Telerik team
 answered on 12 Dec 2012
1 answer
78 views
When I attempt to click the following list view item:
<ul data-role="listview" data-style="inset" data-type="group">
        <li>
            <ul>
                <li data-icon="toprated" ><a data-url="/url">item 1</a></li>
            </ul>
        </li>
</ul>
I receive the following error:

Uncaught TypeError: Cannot call method 'getAttribute' of undefined
Petyo
Telerik team
 answered on 12 Dec 2012
2 answers
175 views
So I've dug all through this trying to figure out what is wrong with the filtering and I can't seem to figure it out. Basically my issue is using the "Ends with" filter on a string type. I have been able to reproduce a sample of this and put it on JSFiddle:

Click to view demo

If you filter on the Name column, select "Ends with" and the text "Smith" you get the people named: Joe Smith, Ryan, and Slappy Smith. How or why Ryan got in there is baffling to me...as he clearly shouldn't be.

I stepped through a good portion of the open source and found that this is what's happening:
(d.Name.toLowerCase().lastIndexOf('smith') == d.Name.toLowerCase().length - 5)

I'm assuming this has something to do with the way the data is being cached/queried but I have been unable to find a solution. At first I thought it may be because "Ryan" is shorter than the string I'm searching for, but in that case Don and Bob should have showed up as well...

Any thoughts/explanations/solutions?
Nikolay Rusev
Telerik team
 answered on 12 Dec 2012
1 answer
265 views
HI All,
              I have displayed URL in my kendo Grid, i set the column width =140. when i bind the grid URL column not wrap up with in the column[It expand long],This is error will come only IE ,it is working correctly in Mozilla.Please provide the information as soon as possible.


Thanks
Parthasarathi M
Dimo
Telerik team
 answered on 12 Dec 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
Date/Time Pickers
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)
SPA
Filter
Drawing API
Drawer (Mobile)
Globalization
Gauges
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
OrgChart
TextBox
Effects
Accessibility
ScrollView
PivotGridV2
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Collapsible
Localization
MultiViewCalendar
Touch
Breadcrumb
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
Popover
DockManager
FloatingActionButton
TaskBoard
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
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?