Telerik Forums
Kendo UI for jQuery Forum
1 answer
238 views

Anyone else have this happen?

Adding kendo.all.* in my BundleConfig.cs throws a javascript error every time (only for IE browser):

Microsoft JScript runtime error: Unable to get value of the property 'msie': object is null or undefined

I'm using IE9.  The debugger highlights this code inside the kendo.all.min.js file:

D=e.browser.msie&&8>parseFloat(e.browser.version)?function(e){return e.offsetTop}:function(t){return t.offsetTop-e(t).height()}

I'm using jQuery 1.9.1 and my bundleconfig class has the below code (I've put all css first, but the js files order is correct per Kendo documentation)

01.public class BundleConfig
02.{
03.    public static void RegisterBundles(BundleCollection bundles)
04.    {
05.        bundles.Add(new StyleBundle("~/Content/css").Include(
06.                    "~/Content/site.css"));
07. 
08.        bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
09.                    "~/Content/themes/base/jquery.ui.all.css"));
10. 
11.        // Kendo CSS bundle
12.        bundles.Add(new StyleBundle("~/Content/kendo").Include(
13.                    "~/Content/kendo.common.*",
14.                    "~/Content/kendo.default.*"));
15. 
16. 
17.        bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
18.                    "~/Scripts/jquery-{version}.js"));
19. 
20.        bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
21.                    "~/Scripts/jquery-ui-{version}.js"));
22. 
23.        bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
24.                    "~/Scripts/jquery.unobtrusive*",
25.                    "~/Scripts/jquery.validate*"));
26. 
27.        bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
28.                    "~/Scripts/modernizr-*"));
29. 
30.        // Kendo Script bundle
31.        bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
32.                    "~/Scripts/kendo.all.*",
33.                    "~/Scripts/kendo.aspnetmvc.*"));
34. 
35.        // Clear all items from the ignore list to allow minified CSS and JavaScript files in debug mode
36.        bundles.IgnoreList.Clear();
37. 
38. 
39.        // Add back the default ignore list rules sans the ones which affect minified files and debug mode
40.        bundles.IgnoreList.Ignore("*.intellisense.js");
41.        bundles.IgnoreList.Ignore("*-vsdoc.js");
42.        bundles.IgnoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);
43. 
44.    }
45.}
Vladimir Iliev
Telerik team
 answered on 13 May 2013
1 answer
94 views
This is in reference to the documentation at http://docs.kendoui.com/getting-started/framework/spa/router.

It indicates that "/items" is valid for the route "/items/*suffix" but it does not match because there is no trailing slash. If I use a route of "/items*suffix" instead it works.

Perhaps you can correct the documentation, so that it isn't misleading.

Thanks,
Gary
Petyo
Telerik team
 answered on 13 May 2013
1 answer
83 views
My app sets up several routes and then starts the router. I have a scenario now in which I'm loading additional code on demand, which requires its own routes. I need the new routes to be inserted at the beginning of the route collection because they handle more specific cases than what was added initially.

I got it working using the following code:
_router.route(route, callback);
_router.routes.unshift(_router.routes.pop());
Is this the recommended approach?

Thanks,
Gary
Petyo
Telerik team
 answered on 13 May 2013
5 answers
131 views
I'm not sure where to post bug information. Please let me know if it should go somewhere other than here.

In 2013 Q1's builds (and at least the current latest internal build as well as the previous) kendo core references the wrong jQuery instance. Using the latest internal build as reference (build 506):

  • Line 2790 uses jQuery.each instead of $.each
  • Line 2794 uses jQuery.event.special instead of $.event.special
  • Line 2806 uses !jQuery.contains instead of !$.contains
I'm sure these go unnoticed to most users but I wrap my kendo scripts to be loaded with RequireJS and it's important that the correct reference provided by the closure is used.
Petyo
Telerik team
 answered on 13 May 2013
1 answer
137 views
My code below does not populate the fields in the grid. I get an empty grid with headers only.
Fiddler shows that the read is executed and returning results. Any ideas?
$("#pageresultGrid").kendoGrid({
            dataSource: {
                type: "odata",
                schema: {
                    model: {
                        fields: {
                            DRG: { type: "string" },
                            DRGDescription: { type: "string" },
                        }
                    },

                    errors: function (response) {
                        return response.errors;
                    },
                    data: function (response) {
                        return response["value"];
                    }
                },
                transport: {
                    read: {
                        url: ksWebApiSearchUrl,
                        dataType: "jsonp"
                    }
                }
            },

            pageable: {
                numeric: true,

                refresh: true,

                pageSize: 5,

                previousNext: true,

                input: false,

                info: false,
                messages: {
                    display: "Viewing {0} - {1} of {2}",
                    empty: "No items to display",
                    page: "Page",
                    of: "of {0}",
                    itemsPerPage: "items per page",
                    first: "Go to the first page",
                    previous: "Go to the previous page",
                    next: "Go to the next page",
                    last: "Go to the last page",
                    refresh: "Refresh"
                }
            },
            sortable: true,
            columns: [
            {
                headerTemplate: '<input type="checkbox" id="checkAll">',
                template: '<input type="checkbox" value="1" id="results-select-row1"><label class="visuallyhidden" for="results-select-row1">Select Row</label>',
                width: 40
            },
            {
                field: "DRG",
                headerAttributes: {
                    "class": "ks-gridheader"
                },
                template: '<a href="javascript:GetTabDetail(#=DRG#)">#=DRG#</a>',
                width: 60,
                title: "DRG"
            },
            {
                field: "DRGDescription",
                headerAttributes: {
                    "class": "ks-gridheader"
                },
                width: 130,
                title: "DRG Description"
            }
            ]
        });
Nikolay Rusev
Telerik team
 answered on 13 May 2013
0 answers
106 views
It seems that the kendo ui only suppert to pass the parameter like string,int ,but not List<student> this custom class.

ActionResult GetStudentImfo([DataSourceRequest] DataSourceRequest request, string name, int id)
this format is OK,but
ActionResult GetStudentImfo([DataSourceRequest] DataSourceRequest request,List<student>) is not OK.
xi
Top achievements
Rank 1
 asked on 12 May 2013
1 answer
573 views
For some reason the delete dialog is firing twice.  It doesn't call the destroy function until after you go through both dialogs.

Any ideas?

001.<div id="grid"></div>
002. 
003.<script>
004.    $(document).ready(function() {
005.        var crudServiceBaseUrl = "main.php?a=quotereport", dataSource = new kendo.data.DataSource({
006.            transport : {
007.                read : {
008.                    url : crudServiceBaseUrl + "&read=1",
009.                    dataType : "json"
010.                },
011.                destroy : {
012.                    url : crudServiceBaseUrl + "&destroy=1",
013.                    dataType : "json"
014.                },
015.                parameterMap : function(options, operation) {
016.                    if (operation !== "read" && options.models) {
017.                        return {
018.                            models : kendo.stringify(options.models)
019.                        };
020.                    }
021.                }
022.            },
023.            batch : true,
024.            schema : {
025.                data: "data",
026.                total: "total",
027.                model : {
028.                    id : "id",
029.                    fields : {
030.                        id: {
031.                            validation : {
032.                                required : true
033.                            }},
034.                        first_name: {
035.                            validation : {
036.                                required : true
037.                            }},
038.                        last_name: {
039.                            validation : {
040.                                required : true
041.                            }},
042.                        dob: {
043.                            validation : {
044.                                required : true
045.                            }},
046.                        email: {
047.                            validation : {
048.                                required : true
049.                            }},
050.                        phone: {
051.                            validation : {
052.                                required : true
053.                            }},
054.                        age: {
055.                            validation : {
056.                                required : true
057.                            }},
058.                        date: {
059.                            validation : {
060.                                required : true
061.                            }}
062.                    }
063.                }
064.                }
065.        });
066. 
067.        $("#grid").kendoGrid({
068.            dataSource : dataSource,
069.            pageable : false,
070.            height : 430,
071.            editable: 'inline',
072.            columns : [{
073.                field : "id",
074.                title : "ID"
075.            }, {
076.               field  : "date",
077.               title  : "Date"
078.            }, {
079.                field : "first_name",
080.                title : "First Name"
081.            }, {
082.                field : "last_name",
083.                title : "Age"
084.            }, {
085.                field : "dob",
086.                title : "Birthday"
087.            }, {
088.                field : "email",
089.                title : "Email"
090.            }, {
091.                field : "phone",
092.                title : "Telephone"
093.            }, {
094.                field : "age",
095.                title : "Age"
096.            },           
097.            {
098.                command : ["destroy"],
099.                title : " ",
100.                width : "160px"
101.            }]
102.        });
103. 
104.    });
105.</script>
Jayesh Goyani
Top achievements
Rank 2
 answered on 12 May 2013
4 answers
1.0K+ views
Hi,

I am trying to work out a way to use the Upload Async control to upload a single file multiple times. 

The situation is the user will be able to upload a receipt file (most likely a pdf) for an expense they incurred which will go along with a few other attributes such as price and category. The data collected will be done using Knockout as part of an ASP.NET MVC site. They will be able to add multiple expenses but only one receipt file to go along with it.

So I want to be able to have a form which has the other attributes as well as the ability to upload a receipt to go along with it. However I want the upload event to be fired when they click "Add Expenditure" and the remove event to be called when they click "Remove Expenditure".  Is there a way to manually call these events?

Thanks.
Gabriel
Top achievements
Rank 1
 answered on 12 May 2013
2 answers
328 views
Hello,

I'm new to Kendo UI framework but i have some experience with jQuery / AJAX.

I have problem with submiting value from my JS script to php file (simple AJAX works fine).

Here are my both php and js code.

var userList = new kendo.data.DataSource({
                transport: {
                    read: {
                        url: "php/usersModel.php",
                        dataType: "json"},
                        data: {operationCode:"showUsers"},
                        type: "post"
                     
                            
                },
                pageSize:10
                 
                 
            });
Without posting data it works fine (I tried with one-funciton-only php file). But in php file i have Switch function, every time my usersModel.php is requested i POST operationCode. When operationCode =="showUsers", showUsers function should be called, when I POST "showLogs" showLogs funciton in PHP file should be called.

In Chrome Console im getting this error: Uncaught TypeError: Cannot read property 'slice' of null.
There is my php code:
$operationCode = $_POST['operationCode'];
$conn= new MySQLI($host,$user,$DBpassword,$baza);
 
if (!empty($operationCode))
{
    Switch($operationCode)
        {
        case "deleteUser" :
            if (!empty($id))
                    {
                    deleteUser($id,$conn,$baza);
                    }
            break;
             
        case "showUsers" :
            showUsers($conn,$baza);
            break;  
        case "addUser" :
            addUser($baza,$conn,$serializedData,$operationCode);
            break;
        case "editUser":
            editUser($conn,$baza,$serializedData,$operationCode);
            break;
        case "showLogs":
            showLogs($conn);
            break;
        }
}
 
function showUsers($conn,$baza)
{
     
    $queryString="select id,username,email,telefon,imie,nazwisko,userlevel from ".$baza.".users t1 left join user_dane t2 on t1.id=t2.userid where t1.userlevel<>9 order by t1.id";
    $results=mysqli_query($conn,$queryString);
 
        $usersResult = array();  
        while ($row=mysqli_fetch_assoc($results))
        {
             
             
            array_push($usersResult,
                       array('id'=>$row['id'],
                             'username'=>$row['username'],
                             'email'=>$row['email'],
                             'telefon'=>$row['telefon'],
                             'userlevel'=>$row['userlevel'],
                             'imie'=>$row['imie'],
                             'nazwisko'=>$row['nazwisko']
                              
                             )
                        
                        
                       );
                      
        }
        echo json_encode($usersResult);
         
}

Of course db,host and other variables are defined properly.

I hope someone here is able to help me. And sorry for my !perfect English ;)

Best regards.
Hemant
Top achievements
Rank 1
 answered on 11 May 2013
7 answers
672 views
Hi Team,

I have a grid in web user control and I am dynamically adding that user control in Asp.net Web Forms(not MVC architecture). I want to show the kendo ui chart dynamically for each and every instance of web user control under the grid. All the examples in web for kendo ui provides a static div with id as chart  " <div id="chart"></div>". But requirement is I want to show the chart dynamically. For example I am dynamically creating two user controls(control1,control2) each have different datasource. I want the kendo chart to be shown under this web user control. Can anyone provide a solution to this.

Thanks,
R.Jaganathan
jagan
Top achievements
Rank 1
 answered on 11 May 2013
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
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?