Telerik Forums
Kendo UI for jQuery Forum
8 answers
290 views
Hi,

i have an grid with XML binded Datasource. One Column has numeric Data but the grid use alphabetic sort order. Example 1, 100, 2, 200, 3, 300 etc..
Can i use an numeric sort order (1,2,3,100,200,300) ?. How?

The Sourcecode:
$("#grid").kendoGrid({
sortable: true,
selectable: "single",
change: onChange,
            dataSource: {
serverPaging: false,
                serverSorting: false,
                
transport: {
read: {
                        url: "../GetSachbearbeiterListe",
                        dataType: "xml",
                        data: {
                            Suchbegriff: ""
                        }
                    }
                },
schema: {
                    type: "xml",
id: "f07001",
                    data: "/response/update/tabelle/satz",
total: "/response/update/anzahl/text()",
                    model: {
                        fields: {
                            f07001:  { field: "f07001/text()", type: "number" },
                            f07002: "f07002/text()",
f07110: "f07110/text()", 
f07013: { field: "f07013/text()", type: "text" }
                        }
                    }
                }
            },
scrollable: {
                virtual: false
            },
            columns: [{
field: "f07001",
title: "Sb-Nr.",
width: 20
}, {
field: "f07002",
title: "Name",
width: 100
}, {
title: "Status",
width: 30,
template: "#= gContentSachbearbeiter.formatStatusColumn(f07110) #"
}, {
field: "f07013",
width: 70,
title: "Aussendarstellung"
}
]
        });
}
Nikolay Rusev
Telerik team
 answered on 29 Feb 2012
3 answers
163 views
Hi telerik team,

I drew bar chart using basic bar chart sample codes. But I wanna draw bar chart with various colors.
I used stack option and It works. But num value cannot be used like next codes.
Can't I use num value like '1' in X: "1" or  '1':15.7 ?
It occurs errors like attacted file.
Please tell me how to make codes. ^^

<script>
                function createChart() {
    var chartData = [
   { X: "1" , '1':15.7, '2': 0, '3': 0, '4': 0, '5':0},
   { X: "2" , '2':16.7, '1': 0, '3': 0, '4': 0, '5':0},
   { X: "3" , '3':20,   '1': 0, '2': 0, '4': 0, '5':0},
   { X: "4" , '4':23.5, '1': 0, '2': 0, '3': 0, '5':0},
   { X: "5" , '5':26.6, '1': 0, '2': 0, '3': 0, '4':0}
];
                    $("#chart").kendoChart({
     dataSource: {
      data: chartData
   },
                        theme: $(document).data("kendoSkin") || "default",
                        title: {
                            text: "Internet Users"
                        },
                        legend: {
                            position: "bottom"
                        },
                        seriesDefaults: {
                            type: "column",
       stack: true
                        },
                        series:
       [
        { field:"1",  name: "1", color:"red" },
        { field:"2",  name: "2" },
        {   field:"3",  name: "3"     },
        { field:"4",  name: "4" },
        {   field:"5",  name: "5" }
       ],
                        valueAxis: {
                            labels: {
                                format: "{0}%"
                            }
                        },
                        categoryAxis: {
                            field:'X'
                        },
                        tooltip: {
                            visible: true,
                            format: "{0}%"
                        }
                    });
                }

                $(document).ready(function() {
                    setTimeout(function() {
                        createChart();

                        // Initialize the chart with a delay to make sure
                        // the initial animation is visible
                    }, 400);

                    $(document).bind("kendo:skinChange", function(e) {
                        createChart();
                    });
                });
            </script>

Min
Top achievements
Rank 1
 answered on 29 Feb 2012
1 answer
277 views

 public partial class GetAirport : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Write(GetAiport(Request.QueryString["apt"]));
        }
        public string GetAiport(string term)
        {
     
              using (D4AgencyModelDataContext dc = new D4AgencyModelDataContext())
              {
                  var citta = (from city in dc.d4agency_Airport_Cities
                               join c in dc.d4agency_Countries
                               on city.Paese equals c.Code
                               where city.Airport.StartsWith(term) && (city.TypeApt.Equals('A') || city.TypeApt.Equals('C'))
                               select new
                               {
                                   city.CodAirport, city.Airport , city.City , c.Description , city.Stato
                               });          

                                             string jsonStr = JsonConvert.SerializeObject(citta);
                  return jsonStr;

              }           
        }
      

    }

Hello i have a porblem whit the autocomplete
in my page :

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="D4Agency.Test" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
    <link href="/Jquery/Kendo/styles/kendo.common.css" rel="stylesheet"/>
    <link href="/Jquery/Kendo/styles/kendo.default.css" rel="stylesheet"/>
   
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
  
    <script src="/Jquery/Kendo/js/jquery.min.js" type="text/javascript"></script>
    <script src="/Jquery/Kendo/js/Kendo.all.min.js" type="text/javascript"></script>
    <script src="/Jquery/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
  
  
   
    <script type="text/javascript">

  
    $(function()
    {
    $("#txtFrom").kendoAutoComplete(
    {
        minLength: 3,
        filter: 'contains',
        severFiltering: true,
        serverPaging: true,
dataTextField: "CodAirport", 
        dataSource:
        new kendo.data.DataSource(
            {
            type: "json",
            transport: {
            read: "/Search/GetAirport.aspx",
                parameterMap: function() {
                return {
                apt: $("#txtFrom").data("kendoAutoComplete").value()
                    };
                }
 
            }
                 
            })
     });

 })
    </script>
<body>

    <form id="form1" runat="server">
    <div>
    <asp:TextBox runat="server" ID="txtFrom"   Width="220px" />
    </div>
    </form>

</body>
</html>

the sistme send me this error :

function anonymous(d, __f, __o) {
return (d.CodAirport.toLowerCase().indexOf('lin') >= 0)
}

 

 

 

 

 

Andrew
Top achievements
Rank 1
 answered on 29 Feb 2012
2 answers
192 views

Is anyone expiencing the problem when using the Metro theme that textboxes seem to get some weird padded border. When adding an autocomplete, it gets even worse.

I'm not applying any CSS at all. The sample attached was a new site. The top image is when hovered over.

Here is the code:

<form id="frmSearch" method="get" action="@Href("~/collections/search")" class="btnSearch">
    <input id="txtSearch" type="text" name="q" placeholder="@defaultValue" class="k-textbox" style="width:40%;" required />
    <button class="k-button dark" id="btnSearch">
        search</button>
    </form>

Here is the JS:

// Search box.
    $("#txtSearch").kendoAutoComplete({
        change: onSearchClick,
        minLength: 3,
        dataTextField: "title",
        delay: 400,
        dataSource: new kendo.data.DataSource({
            type: "json",
            pageSize: 10, // Required to prevent caching.
            serverFiltering: true, // Required to prevent caching.
            serverPaging: true, // Required to prevent caching. 
            transport: {
                read: getRootDomain() + "/findTitles",
                parameterMap: function (options) {
                    return $.extend(options, {
                        title: $("#txtSearch").data("kendoAutoComplete").value()
                    });
                }
 
            }
        })
    });
    // Initialize and configure the input validator for the search box (on collection page).
    var validator = $("#frmSearch").kendoValidator({
        rules: {
            custom: function (input) {
                // Prevent anything under 3 characters from being allowed.
                return input.val().length > 2;
            }
        },
        messages: {
            custom: "You need 3 or more charactors"// Shows when <3 character is entered.
            required: "Oops, you forgot me!" // Shows when the search box is left blank.
        }
    }).data("kendoValidator");
    $("#btnSearch").click(function () {
        if (validator.validate() == false) {
        }
    });

 
EDIT: also the documentation for the validator regarding the SPAN tag to fix alignment does not work in the above situation.
The attached image icon on this post says it is a GIF when it is a PNG

Gabriel
Top achievements
Rank 1
 answered on 29 Feb 2012
0 answers
102 views
I've styled my textbox to have a button to search - pretty much identical to functionality and layout to Bing.
Problem is, the autocomplete drop-down list with suggestions is only the width of the input box - how would I add some extra width to it to account for the width of my search button?

Also, how do I set the height to be large enough to fit ALL the suggestions, including any the have been wrapped to another line?
Gabriel
Top achievements
Rank 1
 asked on 29 Feb 2012
3 answers
112 views
Where are the questions & answers I can take a look at from the webinar this past week?

The administrtor of the webinar said he was going to post them to the web site...   
John
Top achievements
Rank 1
 answered on 29 Feb 2012
1 answer
139 views

I'm stuck with a data source and a grid. The data is to be shown in a grid but I can't get it too work.

<div id="grid"></div>
 
            <script>
                $(document).ready(function() {
 
            var d={"count":0,"subTotal":0,"items":{"sku":"dvdwinf","title":"Doctor Who:
 
Inferno","price":19.95,"format":"DVD","url":"drwho/doctor-who-inferno/dvdwinf","quantity":1}}
 
 
                    $("#grid").kendoGrid({
                        dataSource: {
                            data: d,
                            pageSize: 10
                        },
            schema: {
                   data: "items"
                    },
                        height: 250,
                        scrollable: true,
                        sortable: true,
                        pageable: true,
                        columns: [
                            {
                                field: "sku",
                                title: "First Name"
                            },
                            {
                                field: "title"
                            }
                        ]
                    });
                });
            </script>

The data to show will be a from a web service but for now it is hot-wired in there for testing. The JSON object is properly formatted and the EXACT data is used with a jQuery AJAX request elsewhere and used just fine. Any ideas?

Gabriel
Top achievements
Rank 1
 answered on 29 Feb 2012
1 answer
249 views
I'd like to cancel a selection change in the change event based on user input. Is this possible?

Here's a jsfiddle of what I'm attempting to do:
http://jsfiddle.net/latenightcoder/R4mKu/1/
Chris
Top achievements
Rank 1
 answered on 29 Feb 2012
2 answers
223 views
I am trying to debug a call to WCF RIA Service that return JSON data. when using .Ajax it works fine, but does not work when using it for Kendo Grid. I am trying to find out if there are any callbacks for Success or Error for dataSource ?

also Additionally i want to use Paging,sorting and Filtering on server, do you have sample which does it using
 WCF RIA service ?


 <script type="text/javascript">
        $(document).ready(function () {
            $("#grid").kendoGrid({
                dataSource: {
                    type: "json",
                    transport: {
                        read: "http://localhost:50424/Services/Silverlight_WCF_RIA-Web-MyDomainService.svc/JSON/GetSecurity_Users"
                    },
                    schema: {
                        model: {
                            fields: {
                                First_Name: { type: "string" },
                                Last_Name: { type: "string" },
                                Email_Address: { type: "string" }
                            }
                        }
                    },
                    pageSize: 10,
                    serverPaging: true,
                    serverFiltering: true,
                    serverSorting: true
                },
                height: 250,
                filterable: true,
                sortable: true,
                pageable: true,
                columns: [{
                    field: "First_Name",
                    width: 90,
                    title: "First Name"
                }, {
                    field: "Last_Name",
                    width: 90,
                    title: "Last Name"
                }, {
                    field: "Email_Address",
                    title: "Email"
                }
                ]
            });
        });
    </script>
Mike
Top achievements
Rank 1
 answered on 28 Feb 2012
2 answers
289 views
Hi,

I have a grid that allows grid edition and I soon as I add the grid template, I'm no longer be able to edit the cell withing the grid.
Unfortunately I found examples of each of one but not the two mixed together.

I specify the row template like this:
rowTemplate: $.proxy(kendo.template($("#rowTemplate").html()), ds),

The only reason I need the row template in this case is to provide the necessary CSS (text-align:right) to align amount field column.
Maybe this could be achieved in a different way?

Thanks.
Patrick Rioux
Top achievements
Rank 1
 answered on 28 Feb 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
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
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
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?