Telerik Forums
Kendo UI for jQuery Forum
1 answer
138 views
Hello,
I am a newbie... but I want to learn how I can binding my webservice to my DataViz; Pie Chart.

I am trying to use my Webservice .asmx that return a string (I converted a List into a JSON string using  System.Web.Script.Serialization.JavaScriptSerializer )

But when it is created my pie chart only appear the title...


I used my returned JSON string like a local data and  my chart was created. (By that reason I think that my json string isnĀ“t the problem)

Please a need some advices...

Regards,
M.
Alexander Valchev
Telerik team
 answered on 30 Mar 2012
4 answers
472 views
Hi, All;

I'm trying to build a simple grid bound to json data. The grid shows up but it's always empty. Help?
<div id=grid>
</>
<script type="text/javascript">
    var dataSource = new kendo.data.DataSource({
        transport: {
            read: {
                url: "http://localhost:3223/DataServices/DomainService.svc/JSON/GetDATA",
                dataType: "json"
            }
        },
        schema: {
            data: "RootResults"
        }
    });
    dataSource.read();
</script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#grid").kendoGrid({
            dataSource: dataSource,
            columns: [
                { title: "ID", field: "ID" },
                { title: "CODE1", field: "CODE1" },
                { title: "CODE2", field: "CODE2" }
            ],
            height: 360,
            groupable: false,
            sortable: false,
            pageable: false,
            scrollable: false
        });
    });
</script>
David
Top achievements
Rank 1
 answered on 30 Mar 2012
2 answers
178 views
Hi,

I'm having some trouble binding a KendoUI chart to a remote database through a web service.

Here is my code:

$("#chart").kendoChart({
    theme: $(document).data("kendoSkin") || "default",
    dataSource: {
        transport: {
            read: {
                url: "/WebServices/WebFunctions.asmx/RetrieveProjectCountByBMP",
                dataType: "json"
            }
        },
        schema: {
            model: {
                fields: {
                    Code: { type: "string" },
                    Count: { type: "number" }
                }
            }
        },
        sort: {
            field: "Code",
            dir: "asc"
        }
    },
    title: {
        text: "Project Count by BMP"
    },
    seriesDefaults: {
        type: "column"
    },
    series: [{
        field: "Count",
        name: "Project Count"
    }],
    categoryAxis: {
        field: "Code"
    },
    tooltip: {
        visible: true,
        format: "{0:N0}"
    }
});

and here is the web service code:

<WebMethod(EnableSession:=True)> _
Public Function RetrieveProjectCountByBMP() As Object
    Dim returnData = (From p As Project In Project.RetrieveAll() _
                     Join cs As ClaimScope In ClaimScope.RetrieveAll() On p.ProjectId Equals cs.ProjectId _
                     Join b As BMP In BMP.RetrieveAll On cs.BMPId Equals b.BMPId _
                     Where (p.ProjectMilestoneId = 17 Or p.ProjectMilestoneId = 18 Or p.ProjectMilestoneId = 19) _
                     And p.FiscalyearId = 5 _
                     Select b.Code, p.ProjectId).GroupBy( _
                        Function(bmpCode) bmpCode.Code _
                        , Function(proj) proj.ProjectId _
                        , Function(bmpCode, projects) New With {.Code = bmpCode, .Count = projects.Count()})
 
    Dim serializedReturnData As JavaScriptSerializer = New JavaScriptSerializer(returnData)
 
    Return serializedReturnData.Serialize(serializedReturnData)
 
    Return serializedReturnData
End Function


I've verified that my webservice returns a complete dataset. 
The problem is that when I run the code, the chart doesn't get populated. There are no error messages and no events fired in the event log.

The only issue I can find is that the webservice returns the data with leading a trailing quotes, like this:

"[{"Code":"1301","Count":239},{"Code":"1401","Count":178},{"Code":"1001","Count":33}]"

When I copy the data returned from the web service into a .json file and bind the chart to that, it works fine. However, I have to remove the leading and trailing quotes to get it to work.

How can I get my webservice to return my data in proper JSON format?

Thanks. 
Monique
Top achievements
Rank 1
 answered on 30 Mar 2012
4 answers
1.0K+ views
Another question for you lovely Kendo people!

I'm currently struggling to bind more than one function to a Grid, my code is:

<div id="grid" data-role="grid" data-bind="source: gridSource"></div>

Which works fine, but I want this Grid to be a multi-selectable Grid (my own Kendo extension) and can't seem to bind this when I try:

<div id="grid" data-role="grid" data-bind="source: gridSource, selectableGrid: selectOptions"></div>

The error displays as "selectableGrid" is not supported by "div" or something along those lines. However, if I try and just use the selectableGrid without the source binding, then it works fine.

Any suggestions, or will this be fixed in a future release?
Chris
Top achievements
Rank 1
 answered on 30 Mar 2012
2 answers
114 views
Hi,

I'm having troubles trying to update a chart: http://jsfiddle.net/luisk/aHFwc/

I'm using chart.dataSource.data(prb);

As you can see in the example, the title is changing but the data source is not.

Thanks!
Luis Carlos
Top achievements
Rank 2
 answered on 30 Mar 2012
0 answers
97 views
Hi!

I am unable to retrieve the e.data.id because events from detailExpand is undefined. For detailInit, it's okay. Do you know why? Is there a bug or is this written in this way?

                detailInit: function(e) {
                            console.log(e.data.id);
                },
                detailExpand: function(e) {
                             console.log(e.data.id);
                 },   
George
Top achievements
Rank 1
 asked on 30 Mar 2012
1 answer
104 views
I would like to display a model window in response to a user clicking on an Axis title of a chart that plot time series data.  This modal window would allow the user to adjust some of our chart settings (Xaxis: time period) and (Yaxis: engineering units of measure).  I have looked through the forums and documentation but cannot seem to find an event.

Thanks
Paul
Iliana Dyankova
Telerik team
 answered on 30 Mar 2012
1 answer
136 views
Hi,

Can anyone tell me how to retrieve the original object that was bound to the grid when a row is selected.
I attached the following callback to the "change" property of  grid.  I assume there is a way to fetch the original JSON object from this "arg" parameter.

function onChange(arg) {                
                .... Need to retrieve the object that was bound to the selected row.
                });

Thanks in advance.
Mohamed
Top achievements
Rank 1
 answered on 30 Mar 2012
1 answer
152 views
Do you have any plans for canvas based visualization components? 

Infragistics is demoing html5 canvas based charts with 500,000 data points where you can zoom in on specific points.  Just wondering if a similar story exists for SVG, performance wise does this translate?  Did you do any published analysis on this?

In the past, the recommended LOB path would have been a plugin (silverlight) to show this amount of data.  Now that this is available with a canvas it is tempting for LOB applications.

T. Tsonev
Telerik team
 answered on 30 Mar 2012
3 answers
1.4K+ views
Hello,

Before the new release, if i wanted to get the JSON object model in a data source, i did :
JSON.stringify(myGrid.dataSource.data());
But now, in the JSON string i have also a "_events" node inside it.

So, how can i get real data ?

Here the jsFiddle : http://jsfiddle.net/eyAkP/13/ 

Best Regards,
Guillaume


Valanto
Top achievements
Rank 1
 answered on 30 Mar 2012
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?