Telerik Forums
Kendo UI for jQuery Forum
1 answer
756 views

I have noticed that while loading my MVC grid read action is called multiple times when there are many rows in the grid. It impacts performance significantly, since read method return json with full grid data every time and it's pretty time consuming.

Any ideas how can I improve grid loading time?

Viktor Tachev
Telerik team
 answered on 30 Nov 2016
2 answers
255 views

Hello,

I'm using a angularjs component inside the ListView template like this:

<!-- Categories Cardview template-->
 <script type="text/ng-template" id="categories-cardview-template">
 <div kendo-list-view="categoriesListView" class="eclub-cardview pager-offset" k-scope-field="cardView"
    
k-options="$ctrl.listViewOptions">
      <div k-template>
        <eclub-category-card category="dataItem" on-select="$ctrl.selectionChanged(card)">
        </eclub-category-card>
      </div>
</div>
 <div kendo-pager k-options="$ctrl.pagingOptions" class="eclub-cardview-pager"></div></script>

The ListView is bound to a Kendo UI Datasource.
I noticed when I add a new item to the Datasource ALL of angular components which are already available in the ListView get re-created.
I tried several ways to add the new item to the Datasource (add, insert, pushCreate), but all with the same result.
So you can imagine the performance hit when the ListView is already displaying let's say 20 items.

Is this normal behavior of the ListView ?

Thanks in advance

William
Top achievements
Rank 1
 answered on 30 Nov 2016
1 answer
233 views

Hi!

I have two cfm (coldfusion) pages that contains multiple charts and have the feature to export the page/charts as pdf. During our iOS testing, the ipad2 that we're using always crashes chrome and when using safari, it just reloads the page without pushing the download. The other page works fine.

The only difference between the 2 page is:

On the page the works properly, the javascript functions are inside the page while the one that crashes, the functions are contained in an external file.

I tried connecting the ipad2 to a Mac to debug and it always crashes when trying to execute kendo.drawing.drawDOM. 

PS: Both exports are working when i tested it on an iPad mini.

Any ideas/suggestions? Thanks,

Below is the code snippet:

kendo.drawing.drawDOM($(clone_id), {avoidLinks: true}).then(function(group) {
    //Render the result as a PDF file
    return kendo.drawing.exportPDF(group, {
        paperSize: "auto",
        margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" }
        });
}).done(function(data) {
        //  Save the PDF file          
        kendo.saveAs({
          dataURI: data,
          fileName: fileName,
          proxyURL: '/Controllers/v2/LearnerDashboard/v2/LearnerSummaryController.cfc?method=openExport',
          forceProxy: true,
          proxyTarget: '_blank'
    });                                
});
Alex Hajigeorgieva
Telerik team
 answered on 30 Nov 2016
1 answer
247 views

I am attempting to write unit tests for a React component that includes a wrapper for a KendoUI chart.  For testing, I am using jsdom so I can write an isolated unit test for each component.  When I attempt to render the component into the jsdom document, I'm getting the following exception:

C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.color.js:352
            var _Color = kendo.Class.extend({
                         ^
 
ReferenceError: kendo is not defined
    at C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.color.js:352:19
    at Object.<anonymous> (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.color.js:559:4)
    at __meta__.id (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.color.js:73:227)
    at Object.module.exports.583 (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.color.js:74:4)
    at __webpack_require__ (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.color.js:21:30)
    at Object.module.exports.0 (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.color.js:49:19)
    at __webpack_require__ (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.color.js:21:30)
    at C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.color.js:41:18
    at Object.<anonymous> (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.color.js:44:10)
    at Module._compile (module.js:409:26)
    at Module._extensions..js (module.js:416:10)
    at Object.require.extensions.(anonymous function) [as .js] (C:\temp\kendo-test\node_modules\babel-core\node_modules\babel-register\lib\node.js:152:7)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.module.exports.585 (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.dataviz.chart.js:79:19)
    at __webpack_require__ (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.dataviz.chart.js:21:30)
    at __meta__.id (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.dataviz.chart.js:109:10)
    at Object.module.exports.625 (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.dataviz.chart.js:116:4)
    at __webpack_require__ (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.dataviz.chart.js:21:30)
    at Object.module.exports.0 (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.dataviz.chart.js:49:19)
    at __webpack_require__ (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.dataviz.chart.js:21:30)
    at C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.dataviz.chart.js:41:18
    at Object.<anonymous> (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\node_modules\kendo\js\kendo.dataviz.chart.js:44:10)
    at Module._compile (module.js:409:26)
    at Module._extensions..js (module.js:416:10)
    at Object.require.extensions.(anonymous function) [as .js] (C:\temp\kendo-test\node_modules\babel-core\node_modules\babel-register\lib\node.js:152:7)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (C:\temp\kendo-test\node_modules\kendo-ui-react-jquery-charts\dist\index.js:7:26)
    at Module._compile (module.js:409:26)
    at Module._extensions..js (module.js:416:10)
    at Object.require.extensions.(anonymous function) [as .js] (C:\temp\kendo-test\node_modules\babel-core\node_modules\babel-register\lib\node.js:152:7)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (C:/temp/kendo-test/src/components/RiskByYearChart.jsx:2:1)
    at Module._compile (module.js:409:26)
    at loader (C:\temp\kendo-test\node_modules\babel-core\node_modules\babel-register\lib\node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .jsx] (C:\temp\kendo-test\node_modules\babel-core\node_modules\babel-register\lib\node.js:154:7)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (C:/temp/kendo-test/test/components/RiskByYearChart-spec.jsx:6:1)
    at Module._compile (module.js:409:26)
    at loader (C:\temp\kendo-test\node_modules\babel-core\node_modules\babel-register\lib\node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .jsx] (C:\temp\kendo-test\node_modules\babel-core\node_modules\babel-register\lib\node.js:154:7)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at C:\temp\kendo-test\node_modules\mocha\lib\mocha.js:222:27
    at Array.forEach (native)
    at Mocha.loadFiles (C:\temp\kendo-test\node_modules\mocha\lib\mocha.js:219:14)
    at Mocha.run (C:\temp\kendo-test\node_modules\mocha\lib\mocha.js:487:10)
    at Object.<anonymous> (C:\temp\kendo-test\node_modules\mocha\bin\_mocha:459:18)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)
    at node.js:974:3
 
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "test"
npm ERR! node v4.5.0
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE
npm ERR! kendo-test@1.0.0 test: `mocha --compilers js:babel-core/register --require ./test/test_helper.js "test/**/*@(.js|.jsx)"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the kendo-test@1.0.0 test script 'mocha --compilers js:babel-core/register --require ./test/test_helper.js "test/**/*@(.js|.jsx)"'.
npm ERR! This is most likely a problem with the kendo-test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     mocha --compilers js:babel-core/register --require ./test/test_helper.js "test/**/*@(.js|.jsx)"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs kendo-test
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls kendo-test
npm ERR! There is likely additional logging output above.
 
npm ERR! Please include the following file with any support request:
npm ERR!     C:\temp\kendo-test\npm-debug.log

 

I'm attaching a zip file with the component and test.  To run (assuming you have nodejs installed):

  • unzip the file
  • from a command prompt cd to the project directory
  • run "npm install"
  • run "npm run test"

Thanks in advance for any help!

T. Tsonev
Telerik team
 answered on 30 Nov 2016
1 answer
770 views

Hi,

I am following example the here to implement kendo ui treeview with remote data binding http://demos.telerik.com/kendo-ui/treeview/remote-data-binding

On expanding a node I need to dynamically pass couple of parameters to get the child items. The given example works perfectly for one parameter. How can I add another parameter? The value of my second parameter comes from one of the columns of the datasource itself.

Thanks

 

 

Peter Milchev
Telerik team
 answered on 30 Nov 2016
1 answer
270 views
Hello,


Is it possible to skip a group template if there's no value in a group field?

For example, I want to group on category and sub-category and I want to display data in the following way:

- Category: 'Automative'

--Sub-category: 'Cars'

----Ferrari

----Lamborghini

--Sub-category: 'Tyres'

---Bridgestone

----Michelin

-Category: 'Bikes'

-- Peugeot

-- Trek




The products in the 'Bikes' category don't have a sub-category - they belong straight to the top category. Unfortunately, if I do grouping on both 'category' and 'sub-category', Kendo UI Grid will add an empty grouping template for the missing sub-category.


Is it somehow possible to skip a group template, if there's no value in a group column?

I've tried using a function for `groupHeaderTemplate`, but unfortunately, it can only put an empty values in a template, it cannot skip the whole group template.

Thanks,

Mike
Dimiter Topalov
Telerik team
 answered on 30 Nov 2016
1 answer
252 views

Hi!

I need to share my current bundle config and _Layout so that someone can correct me if I'm loading too many CSS/Scripts then needed.

BundleConfig:

public class BundleConfig
{
 
private const string KendoVersion = "2016.3.1118";
 
public static void RegisterBundles(BundleCollection bundles)
{
 
    #region Scripts
 
    bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
        "~/Scripts/jquery-{version}.js",
        "~/Scripts/jquery.scrollUp.min.js",
        "~/Scripts/moment.min.js"));
 
    bundles.Add(new ScriptBundle("~/bundles/jqueryMigrate").Include(
        "~/Scripts/jquery-migrate-3.0.0.min.js"));
 
    bundles.Add(new ScriptBundle("~/bundles/niceScroll").Include(
        "~/Scripts/NiceScroll/jquery.nicescroll.min.js"));
 
    bundles.Add(new ScriptBundle("~/bundles/perfectScrollbar").Include(
        "~/Scripts/perfect-scrollbar.jquery.min.js"));
 
    bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
        "~/Scripts/jquery.validate*"));
 
    bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
        "~/Scripts/modernizr-*"));
 
    bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
        "~/Scripts/bootstrap.min.js",
        "~/Scripts/respond.min.js"));
 
    bundles.Add(new ScriptBundle("~/bundles/kendo").Include(
        "~/Scripts/kendo/" + KendoVersion + "/kendo.all.min.js",
        "~/Scripts/kendo/" + KendoVersion + "/kendo.angular2.min.js",
        "~/Scripts/kendo/" + KendoVersion + "/kendo.aspnetmvc.min.js",
        "~/Scripts/kendo/" + KendoVersion + "/kendo.timezones.min.js",
        "~/Scripts/kendo/" + KendoVersion + "/cultures/kendo.culture.en-US-Custom.min.js",
        "~/Scripts/kendo/" + KendoVersion + "/jszip.min.js"));
 
    bundles.Add(new ScriptBundle("~/bundles/custom").Include(
        "~/Scripts/globalize.js",
        "~/Scripts/metisMenu.min.js",
        "~/Scripts/buzz.js",
        "~/Scripts/dist/site.js",
        "~/Scripts/App/Module/Common.js"));
 
    #endregion
 
    #region CSS
 
    bundles.Add(new StyleBundle("~/Content/css").Include(
        "~/Content/bootstrap.min.css",
        "~/Content/site.css",
        "~/Content/normalize.css"));
 
    bundles.Add(new StyleBundle("~/Content/custom/css").Include(
        "~/Content/metisMenu.min.css",
        "~/Content/site/site.css",
        "~/Content/animate.css"));
 
    bundles.Add(new StyleBundle("~/Content/kendoThemeCommon/css").Include(
        "~/Content/kendo/" + KendoVersion + "/kendo.common.min.css"));
 
    bundles.Add(new StyleBundle("~/Content/kendoThemeCommonBootstrap/css").Include(
        "~/Content/kendo/" + KendoVersion + "/kendo.common-bootstrap.min.css"));
 
    bundles.Add(new StyleBundle("~/Content/kendoThemeBootstrap/css").Include(
        "~/Content/kendo/" + KendoVersion + "/kendo.bootstrap.min.css"));
 
    bundles.Add(new StyleBundle("~/Content/kendoRtl/css").Include(
        "~/Content/kendo/" + KendoVersion + "/kendo.rtl.min.css"));
 
    bundles.Add(new StyleBundle("~/Content/kendoMobile/css").Include(
        "~/Content/kendo/" + KendoVersion + "/kendo.mobile.all.min.css"));
 
    bundles.Add(new StyleBundle("~/Content/kendoDataViz/css").Include(
        "~/Content/kendo/" + KendoVersion + "/kendo.dataviz.min.css",
        "~/Content/kendo/" + KendoVersion + "/kendo.dataviz-bootstrap.min.css"));
 
    #endregion
 
    bundles.IgnoreList.Clear();
 
    //BundleTable.EnableOptimizations = true;
 
}

Layout:

<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title - System</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, width = device-width">
 
    <!-- css -->
 
    @Styles.Render("~/Content/css")
    @Styles.Render("~/Content/custom/css")
 
    @Styles.Render("~/Content/kendoThemeCommon/css")
    @Styles.Render("~/Content/kendoThemeCommonBootstrap/css")
    @Styles.Render("~/Content/kendoThemeBootstrap/css")
    @Styles.Render("~/Content/kendoRtl/css")
    @Styles.Render("~/Content/kendoMobile/css")
    @Styles.Render("~/Content/kendoDataViz/css")
 
    <!-- jQuery -->
 
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/jqueryMigrate")
    @Scripts.Render("~/bundles/bootstrap")
    @Scripts.Render("~/bundles/niceScroll")
    @Scripts.Render("~/bundles/kendo")
    <script type="text/javascript">
        kendo.culture("en-US");
    </script>
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/custom")
    <script src="https://use.fontawesome.com/06c55d21d7.js"></script>
</head>

Result:
I'm not getting any specific warning in console of hosting browsers but when using the Chrome's extension for Kendo, I get repeated messages regarding common.css missing. Now, I'm going for the Bootstrap style all-out. I need a all-good for the default desktop setup. I'm still a bit confused about Mobile and DataViz and DataViz Mobile. I'm about to start dashboards so I'll be loooking at mobile and DataViz too.

Ianko
Telerik team
 answered on 30 Nov 2016
8 answers
1.4K+ views

I have a remote datasource/grid with something like this as part of the datasource schema model:

model: {fields: {department_id: {type:"number"}, department: {type: "object"} ...

where the nested department object includes fields "id" and "prettyName".  The grid uses incell editing and a "save" button on the toolbar.  The columns include a field for the "department_id":

{field: 'deptID', title:"Department",
template: "#:department.prettyName#",
editor: function(container, options) {
$('<input required name="' + options.field + '"/>')
.appendTo(container)
.kendoDropDownList({

dataSource: remoteDepartmentDatasource,
dataTextField: "prettyName",
dataValueField: "id",   ...

}

This works to a point - the nested "department.prettyName" displays in the grid via the template, and with incell editing the dropdown list (which is fed records identical to the nested "department" object) correctly changes the "department_id" field to the id selected from the dropdown.  But since the grid's display value "prettyName" is coming from the original nested "department" in the grid row's dataSource record, once the editor is exited the grid displays a stale value until the update is made to the server and the server returns an updated record, which isn't until the user decides to click "Save changes".

Is there any clean way to bind things to have BOTH the department_id AND the department object updated from the edit process's dropdown list?  Or is there an event I could hook into, perhaps the dropdown's "close", where I would know enough to push the "department" object onto the record in the grid's dataSource?

Georgi Krustev
Telerik team
 answered on 30 Nov 2016
5 answers
303 views

I am using kendo ui router and want to replace a URL parameter on each change of the route. So on the change event of the router I have the following code:

 

window.history.replaceState({}, document.title, getUpdatedUrl())

The parameter I want to add is updated successfully, but when I navigate back or forward the kendo ui router no longer catches these events, and does not navigate to the appropriate view (the page URL changes properly). Any ideas how to fix this?

Boyan Dimitrov
Telerik team
 answered on 29 Nov 2016
4 answers
425 views

I have a grid that is using the popup editor with customized create and update templates.  The create is working just fine, and the update works if I change one of the dropdowns.  However, if I only change some of the text in the textbox and click the Update button, the update function in the dataSource is not run, even though the dataSource sync function runs.  Do I need to call the onChanges event of the textbox?

I am using Angular for this application, and when I make a change in the textbox, the ng-pristine class is removed and the ng-dirty class is added.  

Christy
Top achievements
Rank 1
 answered on 29 Nov 2016
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
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?