Telerik Forums
Kendo UI for jQuery Forum
1 answer
150 views
As you may be aware, when you add a web page to the home screen of an iOS device it creates a "web clip".  When launched from this icon on the home screen, the site is loaded in Safari in "web app mode".  There are several advantages to this such as going full screen and feeling more like an app and less like a web page.

However, there is a major downside to this.  When you switch to another app on your iPhone then switch back to this "web app", the state of the app is completely lost.  According to several sources on the web, this is by design.  The reasoning by Apple is that they need to be shut down your app to keep resources manageable.  It is the responsibility of the app developer to save state and restore state when the app is reopened.  

OK.  I can accept that and I am almost there.  I am tracking the user's logged in security token, so they don't need to login again.  I also store the current hash so I if I detect that they are launching from with no referrer, I can send them to the same hash they were viewing when they left.  

All is good.... EXCEPT back buttons don't work.  If the user was on a mobile view that had a back button, when the user multi-tasked away from it, then I will, of course, take them back to that page.  However, because there is no history, the Kendo UI mobile back button doesn't know what to do.

So... how can I save off the current navigation history to localStorage and how can I restore it when relaunching the app?

I see that app.pane.history has been deprecated.  This use case of an iOS web app launched from home screen seems pretty mainstream, so what is your current solution to this situation now that app.pane.history has been deprecated.

Thanks,
Ty.
Petyo
Telerik team
 answered on 10 May 2014
1 answer
68 views
I am trying to create a data source from an array of javascript objects that, among other properties, contain a property named "data". The existence of the "data" property causes my Kendo UI controls to break. An example is at http://jsfiddle.net/DsR4e/. If the "data" property is renamed, everything returns to the expected behavior.
Rosen
Telerik team
 answered on 10 May 2014
2 answers
357 views

Hi again all. How can this be converted to a ClientTemplate inside a Kendo Grid?

columns.Bound(document => document.Revisions).Template(@<text>
                @if (item.Revisions.Count <= 1)
                {
                    <div>
                        &nbsp;
                    </div>
                }
                else
                {
                    @Html.Raw(string.Format("<text><a id='img' class='icon' href=\"{1}\"><img src=\"{0}\" alt='' style='border:none;' /></a></text>", Url.Content("~/Images/docrev1.png"), Url.Action("ViewRev", "ViewRevisions", new { id = item.OriginalQRCodeID })));
                }

            </text>).Title("").Width(25);


My problem right now is that "Revisions" is an IEnumerable<T> type bound from the server. How do I get its count from client side? Is this even possible? Thanks very much for all the help and I look forward to the response(s).

Romel

Romel
Top achievements
Rank 1
 answered on 09 May 2014
3 answers
88 views
I have a custom validation method configured for my grid column which is now broken in the latest release.

Here is the source for my validation method:

validnamevalidation: function (input) {
    if (input.is('input[data-bind="value:Name"]')) {
        input.attr("data-validnamevalidation-msg", "A team already exists with that name.");
        var passed = false;
        var currentDataItem = $("#teamsGrid").data("kendoGrid").dataItem($(input.context));
        var currentId = currentDataItem.Id;
        if (currentId == "") currentId = -1;
        $.ajax({
            async: false,
            url: currentViewModel.crudServiceBaseUrl + "CheckTeamNameBeforeAdd?teamId=" + currentId + "&name=" + input.val().trim(),
            success: function (result) {
                if (result == "False") passed = false;
                else passed = true;
            },
            error: function (jqXHR, textStatus, errorThrown) {
                alert(errorThrown + '. ' + jqXHR.responseText);
            },
            complete: function (jqXHR, textStatus) {
            }
        });
        return passed;
    }
    return true;
},


In the latest release, the input.context variable (which I use to obtain the current data row to be validated) is now undefined.

Is this a bug?
Is there a workaround?
Brandon
Top achievements
Rank 1
 answered on 09 May 2014
2 answers
225 views
We are using the Kendo bootstrap theme.  When a Kendo Tooltip is displayed on the right or left, the callout triangle does not appear centered next to the tooltip.  It appears lower than it should, and looks particularly bad when the tooltip contains only a single line of text.  Please see the following for an example:  http://trykendoui.telerik.com/@CodinAndHaulin/AYAs
You'll notice that if you change the Kendo theme in the example (to default or moonlight, etc), the tooltip callouts look proper.
Is there a way I could style the tooltip in Bootstrap theme correctly?
Iliana Dyankova
Telerik team
 answered on 09 May 2014
5 answers
319 views
I am trying to use the slice method on my Observable Array.  Each item in my array has another observable array.  The slice works great, as the objects returned are prefect "copies", but the Observable Arrays in each object are not copied, and therefor still reference the observable array from the item it was copied from.  How can I do a true deep copy for my items with any nested items that item may have?


Thanks and sorry if this sounds confusing.  
Atanas Korchev
Telerik team
 answered on 09 May 2014
4 answers
274 views
Is there a way to programatically trigger the click event on a chart series?  I'm trying to setup a unit test to test the seriesClick function and haven't been able to see anything.  In a somewhat desperate attempt I tried to trigger the click event on everything to see if I got something to trigger the event but it appeared as though nothing hit it; I have some console output as soon as the function runs. I used this line of code to try to execute the event.

$('*').each(function(){
    $(this).click();
});
Collin
Top achievements
Rank 1
 answered on 09 May 2014
4 answers
209 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
107 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
338 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
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
Bronze
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
Bronze
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?