Telerik Forums
Kendo UI for jQuery Forum
4 answers
256 views
I can't figure out what is going on here. I'm trying to make a custom directive for grids and will use element attributes to customize a given instance. In doing so i've made two files

grid-controller.js
app.controller('gridController', ['$scope', function ($scope ) {
 
//Initilization code
 
$scope.gridOptions = {
    //Setup options
};
 
$scope.detailOptions = function (e) {
    console.log('winning');
    return {
        dataSource: {
            transport: {
                read: {
                    url: "/detail" + e.OrderNumber + ".json",
                    dataType: 'json'
                }
            },
            error: function (e) {
                console.log(e);
            },
            pageSize: true,
            serverPaging: false,
            serverFiltering: false,
            serverSorting: false,
        },
        columns: [
                {
                    field: "ItemCode",
                    label: "lblItemCode",
                    title: ""
                }, {
                    field: "ItemDesc",
                    label: "lblItemDesc",
                    title: ""
                }, {
                    field: "QuantityOrdered",
                    label: "lblQuantityOrdered",
                    title: ""
                }
        ],
        scrollable: false,
        sortable: true
    };
}

grid-directive.js

app.directive('grid', function () {
return {
    // Restrict E for element
    restrict: 'E',
    // Here we setup the template for the code we want to replace our directive
    template: "<div> \n\
                    <div kendo-grid='grid' \n\
                         k-options='gridOptions'\n\
                         k-data-source='dataSource'>\n\
                    </div> \n\
                    <script type='text/x-kendo-template'\n\
                            id='details'>\n\
                            <div kendo-grid >\n\
                            </div>\n\
                    </script>\n\
               </div>",
    replace: true,
    scope: {
    },
    controller: "gridController",
    link: function (scope, element, attrs) {
 
        //Gather some attribute data and set it to the gridOptions object
 
 
        if(scope.$eval(attrs.detailsGrid))
        {
            scope.gridOptions.detailTemplate = kendo.template($("#details").html());
            scope.gridOptions.detailInit = scope.detailOptions;
        }
 
        //More customization code
 
        scope.dataSource = new kendo.data.DataSource({
            //Setup dataSource options for main grid
        });
    }
};
});
For sake of brevity i've excluded a lot of the extra code.My problem is whenever I try to open the details of a row the row opens...closes...and the grid appears to refresh. It almost looks like something is crashing and the main grid is refreshing as a result.Here is the associated plunkr with the commented portions fleshed out.
Collin
Top achievements
Rank 1
 answered on 09 May 2014
1 answer
128 views
Hello Team,

I have a project in which I have used list view to show the data. But When I bind the data first time, it works properly, but when bind the data again then it gets small.

I am using the below code :

  <div id="tabstrip-sales-dashboard" data-role="view" data-title="Sales dashboard" data-model="app.loginService.viewModel" data-show="mobileSalesViewInit" data-stretch="false" >
            
            <div>
                <div data-role="content" class="view-content">

                    <ul id="salesperiod" data-role="buttongroup" data-index="0" style="font: bold 0.76em HelveticaNeue,sans-serif;">
                        <li>Today</li>
                        <li>Current Week</li>
                        <li>Current Month</li>
                    </ul>
                </div>
            </div>
 
            <!--<div>-->
                <span id="spMsg"></span>
                <p id="paraspMsg"></p>
                <ul id="ulToday">
                </ul>
            <!--</div>-->
            
        </div>



In above code I am binding data to '  <ul id="ulToday"></ul>'.

This occurs in android. Just I have investigated briefly and I found that when we bind data to listview it creates <div class="listview-wrapper"> and I think It has padding and I think this is why it is causing problem.

Any help would be appreciated.

Thanks



Kiril Nikolov
Telerik team
 answered on 09 May 2014
1 answer
369 views
I have a button inside a listview item, and I do not want it to occupy the whole width of the item. I want to fix the width and right align the button.
I have tried using data-align="right" but that does not help, the button remains left aligned

Here is my code

<ul>
   <li><a data-role="button" data-rel="modalview" href="#modalview-loanamount" id="modalview-open-button">Help</a></li>
</ul>
 
<style scoped>
    #modalview-open-button {
        width:5em;
    }
</style>
Kiril Nikolov
Telerik team
 answered on 09 May 2014
2 answers
329 views
Hello,

I am trying to set the height of all the charts on the page to half of the window size. However I keep getting the following error: Uncaught TypeError: undefined is not a function

The code I have is as follows:

$(window).resize(function () {
        // for any chart or gauge widget
        $(".k-chart").each(function () {
            // get the instance of the chart/gauage
            var chart = kendo.widgetInstance($(this), kendo.ui);
            var c = $(this).data("kendoChart");
            // make sure transitions are off
            //chart.options.transitions = false;
            console.log($(window).height() * 0.4);
            c.height($(window).height() * 0.4);
            // redraw the chart/gauge
            if (chart && chart.redraw) {
                chart.redraw();
            }
        });
    });

The error pops up with the c.height($(window).height() * 0.5); statement. 

Any idea what I am doing wrong? I am running the 2014.1.318 version

Thank you
magdil
Top achievements
Rank 1
 answered on 09 May 2014
11 answers
960 views
I want to retrieve QR code in byte array form, is this possible?
If not what other options could be?

Thanks,
Mahesh A
Daniel
Telerik team
 answered on 09 May 2014
6 answers
145 views
Hi,
In our chart graph, I was trying  to use plotband on categoryAxis. For plot band, we need to define "from" and "to" values for the axis. Is there a way, if I can define "from" value (no "to" value defined) and graph background from "from" defined axis point to end of the axis is colored?

Currently I am doing this by setting "to" value as the "max" axis value.
Also for the plotted graph (as attached), I see the plotband and graph line looks shifted. For eg: In the attached image at bottom, the from date is Apr 15 and to date is Apr 16". Expected  is the point corresponding to 15th Apr and 16th Apr should be inside plotband, which is not the case. Do we need to define some offset. How to fix this issue? 
Hristo Germanov
Telerik team
 answered on 09 May 2014
1 answer
111 views
I'm using the editor to image gallery of Kendo UI, the editor works fine (links, formats, etc. ..) and upload the photos to the gallery and read a service (rest); the problem is that when wanting to insert any image in the gallery get the error:

"too much recursion ... ute (i)," string "== typeof r) {try {r =" true "=== r 0:" false "=== r1:" null "r === null: + r ... jquery .... min.js (line 3) "

The funny thing is that when you remove the configuration "uploadURL", if you insert pictures in the textarea; obviously the plugin no longer gives me the option to upload.

In the documentation (http://docs.telerik.com/kendo-ui/api/web/editor # configuration-ImageBrowser): did not find details about how to fix it.

HTML(Razr)

    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><br>    <script type="text/javascript" src="/js/vendor/kendo-ui/kendo.all.min.js"></script><br><br>    <div class="k-content"><br>            <textarea id="KEditor" rows="10" cols="30" placeholder="@GetText("Content")" maxlength="255" style="height: 500px"></textarea>    <br>    </div>



Js

   
$(document).ready(function() {<br>                $("#KEditor").kendoEditor({<br>                    tools: [<br>                        "fontName",<br>                        "fontSize",<br>                        "foreColor",<br>                        "backColor",<br>                        "bold",<br>                        "italic",<br>                        "underline",<br>                        "justifyLeft",<br>                        "justifyCenter",<br>                        "justifyRight",<br>                        "justifyFull",<br>                        "insertUnorderedList",<br>                        "insertOrderedList",<br>                        "indent",<br>                        "outdent",<br>                        "createLink",<br>                        "unlink",<br>                        "insertImage",<br>                        "viewHtml"<br>                    ],<br>                    imageBrowser: {<br>                        transport: {<br>                            read: {<br>                                type: "GET",<br>                                url: "/api/sites/user-gallery",<br>                            },<br>                            destroy: "/api/sites/user-gallery?action=delete",<br>                            thumbnailUrl: function(path, name) {<br>                                var pictureUrl = decodeURIComponent(name);<br>                                return pictureUrl;<br>                            },<br>                            uploadUrl: "/api/sites/user-gallery?action=upload", //work if this line is commented<br>                            imageUrl: function(name) {<br>                                var pictureUrl = decodeURIComponent(name);<br>                                return pictureUrl;<br>                            },<br>                        }<br>                    }          <br>                    //, messages: { viewHtml: '@GetText("ViewHtml")'}<br>                });<br>            });


Json(read rest service):

Rosen
Telerik team
 answered on 09 May 2014
0 answers
52 views
Dear All,

I am creating resource is Vertical Grouping and time line is showing Horizontal Grouping.

Thanks & Regards
Ramesh.V
Ramesh
Top achievements
Rank 1
 asked on 09 May 2014
2 answers
602 views
Hello Telerik Team , 

We have an issue with the validation tooltip. We could reproduce the behavior in your dojo:
http://trykendoui.telerik.com/EjoN

To reproduce the error just erase a value in the price column, and change the focus to another field, the tooltip looks like is behind the next row.

What is the best way to achieve this?

Thank you in advance, 

Regards!



Luis
Top achievements
Rank 1
 answered on 08 May 2014
6 answers
211 views

We are investigating the use of Kendo to update some of our applications originally developed with Telerik MVC Extensions to be more dynamic.

It appears you have recently updated the DataSource to support SignalR, as shown in the Grid MVC wrapper Demos. It is not however clear from the documentation how far this support goes. In general:

1. What components other than the Grid support SignalR as a data source?

2. Which if any of these support server Push as well as Read?

3. Do any of the DataViz components support SignalR as a source?

4. Can you give us any form of roadmap as to what dynamic update features are to be supported, especially with the Data Viz components and MVC?

Regards

Chris Warren
T. Tsonev
Telerik team
 answered on 08 May 2014
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?