Telerik Forums
Kendo UI for jQuery Forum
1 answer
137 views
Testing in Chrome, using Twitter feed, I am trying to test the 'pullToRefresh' functionality but get this error in Chrome developer tools when I try to pull the list down. :

  1. Uncaught TypeError: Cannot call method 'pullHandled' of undefined
    1. g.extend.refreshkendo.mobile.min.js:2346
    2. e.extend.proxy.gjquery.min.js:538
    3. y.extend.triggerkendo.mobile.min.js:136
    4. o.extend._processkendo.mobile.min.js:1681
    5. o.extend.successkendo.mobile.min.js:1664
    6. e.extend.proxy.gjquery.min.js:538
    7. p.extend.read.c.successkendo.mobile.min.js:1503
    8. f.Callbacks.njquery.min.js:590
    9. f.Callbacks.o.fireWithjquery.min.js:635
    10. f.ajaxTransport.send.d.onload.d.onreadystatechange

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
    <title>My Open Cal</title>
 
    <!-- Kendo UI Files -->
    <link href="styles/kendo.mobile.all.min.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script src="js/kendo.mobile.min.js" type="text/javascript"></script>
    <script>
        $( //jQuery page load
            function ()
            {
                var app = new kendo.mobile.Application($(document.body), { layout: "layout", icon: "/images/xboxavatar.png" });
                $("#ulMyCal").kendoMobileListView({
                    appendOnRefresh: true,
                    pullToRefresh: true,
                    pullTemplate: "Pull to refresh",
                    refreshTemplate: "Loading...",
                    dataSource: new kendo.data.DataSource(
                    {
 
                                transport:
                                {
                                    read:
                                    {
                                        url: "http://search.twitter.com/search.json",
                                        contentType: "application/json; charset=utf-8",
                                        type: "GET",
                                        dataType: "jsonp",
                                        data:
                                        {
                                            q: "#tampa"
                                        }
                                    }
                                },
 
                                schema: {
                                    data: "results"
                                     
                                }
                    }),
                    template:"<p>${text}</p>"
 
            });
 
        })
    </script>
</head>
<body>
 
    <!-- Layout for all views in the application, as specified when the app is created -->
    <div data-role="layout" data-id="layout">
      <div data-role="header" >
          <div data-role="navbar">
            <span data-role="view-title">My Test</span>
          </div>
      </div>
      <div data-role="footer">
          <div data-role="tabstrip">
            <a href="#index" data-icon="organize">My Calendar</a>
            <a href="#search" data-icon="search">Search</a>
            <a href="settings.htm" data-icon="settings">Settings</a>
          </div>
     </div>
    </div>
 
 
    <div data-role="view" id="index" data-title = "My Calendar">
        <div style="text-align:center">
            <ul id="ulMyCal" data-style="inset">
             
            </ul>
        </div>
    </div>
 
    <div data-role="view" id = "search" data-title = "Search">
         
    </div>
 
</body>
</html>
Petyo
Telerik team
 answered on 02 May 2012
0 answers
195 views
i used write this: 
  var lpDpt = $("#LpDepth").kendoDropDownList({
                optionLabel: "--Select--",
                dataTextField: "Depth",
                dataValueField: "Depth",
                index: 0,
                dataSource: dsLpDpt,
                animation: false ,
                change: function () {
                    var value = this.value();
                }
            }).data("kendoDropDownList");

but still i'm getting animation. i followed this :http://www.kendoui.com/forums/ui/tabstrip/setting-tab-animation.aspx
if i used the old version js files i'm getting no effects and optional label not displaying so upgraded to latest "kendoui.complete.2012.1.322.trial", then i'm getting optional label and effects by default,i want to disable effects by animation set to 'false' but this was not working.
Tirumalesh
Top achievements
Rank 1
 asked on 02 May 2012
3 answers
102 views
I've created a simple application with phonegap which consists in 2 html files (index.html and about.html) 
Each of these files contains a single <div data-role="view">.
The index.html contains a button (<a href="about.html" data-role="button">)

If I put these files in a webserver they work correctly (the button when clicked navigates to the about.html page). However if I deploy these files through a phonegap application I get the following error message in LogCat (Android 2.2 emulator): TypeError: Result of expression 'd' [undefined] is not an object. at kendo.mobile.min.js:8

The sushi sample application suffered from the same error with it's "About" button when I deployed it through phonegap.

Is there a workaround this issue or any patch available?

Thanks
Petyo
Telerik team
 answered on 02 May 2012
2 answers
283 views
Having dug around in the code, there appear to be two bugs in the kendo core relating to the handling of percentages.

Bug 1: Parsing percentages to floats
The first bug is fairly simple: percentages are mapped to a number between 0 and 1 for percentages 0% to 100%. The bug appears to be in the method kendo.parseFloat(value, culture). When the value is something like "12%" it correctly identifies it as a percentage here:
} else if (value.indexOf(percentSymbol) > -1) {
    number = percent;
    symbol = percentSymbol;
}
however, it subsequently just removes the percentage symbol but doesn't scale the value down by dividing by 100:
value = value.replace("-", "")
             .replace(symbol, "")
             .replace(nonBreakingSpaceRegExp, " ")
             .split(number[","].replace(nonBreakingSpaceRegExp, " ")).join("")
             .replace(number["."], ".");
 
value = parseFloat(value);
 
if (isNaN(value)) {
    value = null;
} else if (negative) {
    value *= -1;
}
 
return value;

This results in a value such as "12%" being changed to "1,200%" when using the percentage formatting such as:
kendo.toString(value, 'P')

Bug 2: Entering fractional percentages
The second problem I've found relates to using fractional percentage values. In my application I need to display percentages to 10dp and have therefore overridden the culture settings as such:
kendo.cultures["en-US"].numberFormat.percent.decimals = 10;
For reference, here's a stripped down version:
$("#grid").kendoGrid({
  autoBind: false,
  dataSource: {
    schema: {
      model: {
          id: "Title",
        fields: {
          Title: { editable: false },
          Percentage: { editable: true, type: "number" }
        }
      }
    }
  },
  columns: [{
    title: "TITLE",
    field: "Title"
  }, {
    title: "PERCENTAGE",
    field: "Percentage",
    format: "{0:P}"
  }],
  editable: true,
  scrollable: false
});
When providing the original model, a value such as 0.003425 is displayed as "0.3425000000%".
When clicking the cell to edit, the number editor simply displays "0".
If I then enter a fractional value such as "0.012345678912", the expected new value in the model should be "1.2345678912%" but is actually rounded to "1.0000000000%" and the value in the underlying model is saved as 0.01

Is there any way we can get more accurate values working in kendo or is there something else limiting us to 2 d.p. in the model?

Thanks in advance,

Daniel

Georgi Krustev
Telerik team
 answered on 02 May 2012
2 answers
277 views
I have a listview uses the selectable property as true, and in the item templateI have a link to remove an item.

But, when I click the link the change event fires first.

Is there a way to know in the change event that the remove was called?
rlapao
Top achievements
Rank 1
 answered on 02 May 2012
0 answers
41 views
Hi! I'm loftconversions and I download your free trial at Mozilla browser. Although the download was successful but I can't open it at Mozilla itself. I need help please?
John8
Top achievements
Rank 1
 asked on 02 May 2012
1 answer
122 views
Hi,

I'm having a problem programmatically creating a grouped list view that looks like this (from the basic listview demo) :

http://www.captainsjob.com/test/cj/images/listscreen.png 

I've created a cut down demo that recreates my problem page in as simple a way as possible. In the real page I'm using Backbone JS and underscore templating. I can't use

new kendo.mobile.Application()

in this case (which works by the way).

Here is the test page showing my problem. The result is a much simpler list with no grouping. It's missing lots of styles but I don't know why :

http://www.captainsjob.com/test/cj/test.html 

Can you have a look and tell me what I'm doing wrong? It doesn't look like the grouped list view

Thanks
Petyo
Telerik team
 answered on 02 May 2012
1 answer
877 views
Hi all,

I need to iterate through the items in a listview and change them programmatically. It's a point-of-sale app that will have to dataSources, one for FundingSources, which will be loaded once at the beginning of the day, and one for "credit cards", which can have mulitiple FundingSources. So each time a get the info for a credit card, it will return a list of funding sources (CardFundings dataSource) for that card and each record will have a FundingSourceID. Based on that FundingSourceID, I want to populate a FundingSourceName field in the FundingSources dataSource.

I can iterate through the the records in the CardFundings dataSource, but how do I iterate through the items in the associated listview and populate them?

Here's the code:

html:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
 
    @*Kendo*@
    <link href="../../styles/kendo.common.min.css" rel="Stylesheet" />
    <link href="../../styles/kendo.mobile.all.min.css" rel="Stylesheet" />
    <script src="../../js/jquery.min.js" type="text/javascript"></script>
    <script src="../../js/kendo.all.min.js" type="text/javascript"></script>
     
    @*Mine*@
    <script src="../../myJs/Init1.js" type="text/javascript"></script>
    <script src="../../myJs/FundingSources1.js" type="text/javascript"></script>
    <script src="../../myJs/CardFundings1.js" type="text/javascript"></script>
</head>
 
<body>
 
<div id="card-fundings" data-role="view" data-title="Available Funds">
    <div class="head"> </div>
    <h2 id="h2-card-id">Available Funds</h2>
    <ul data-role="listview" data-style="inset" data-type="group">
        <li>
            <ul id="listview-card-fundings">
                <li>Javascript must be</li>
                <li>enabled</li>
            </ul>
        </li>
    </ul>
     <div data-role="footer">
        <div data-role="tabstrip">
            <a id="getCount" data-role="button" data-icon="contacts">Get Count</a>
        </div>
    </div>
</div>
 
    <script id="template-funding-sources" type="text/x-kendo-template">
            <li data-icon="cart"><a href="\#tabstrip-new" class="km-listview-link data-role="listview-link">#= FundingSourceName # #= AvailableBalance #</a></li>
    </script>
 
    <script type="text/javascript">
        $(document).ready(function () {
            init();
        });
    </script>
 
</body>
</html>

And the init() function:

init = function () {
    var kma = new kendo.mobile.Application(document.body);
 
    //android test
    //$("body").removeClass("km-ios").addClass("km-android");
 
    $("#getCount").click(function () {
        enterFundingSourceNames();
    });
 
    getFundingSources();
}

getFundingSources():

FundingSource_Model = kendo.data.Model.define({
    fundingSourceID: "FundingSourceID"
});
  
getFundingSources = function () {
    dsFundingSources = new kendo.data.DataSource({
        transport: {
            read: {
                url: "Home/GetFundingSources",
                dataType: "json"
            }
        },
 
        schema: {
            model: FundingSource_Model
        }
    });
 
    dsFundingSources.read();
 
}
getCardFundings():
CardFunding_Model = kendo.data.Model.define({
    cardID: "CardID"
});
 
getCardFundings = function () {
 
    var templateFundingSources = kendo.template($("#template-funding-sources").html());
 
    dsCardFundings = new kendo.data.DataSource({
        transport: {
            read: {
                url: "/Home/GetCardFundings", // the remove service url
                dataType: "json", // JSONP (JSON with padding) is required for cross-domain AJAX
 
                data: {
                    //additional parameters sent to the remote service
                    _cardId: fundingItem.cardID
                }
            }
        },
 
        schema: {
            model: CardFunding_Model
        },
 
        change: function () { // subscribe to the CHANGE event of the data source
            $("#listview-card-fundings").html(kendo.render(templateFundingSources, this.view()));
        }
    });
 
    dsCardFundings.read();
}
And here's where I need help:
enterFundingSourceNames = function () {
    var thisRecord = null;
    var thisFundingSourceID = null;
    var totCardFundings = dsCardFundings.total();
 
    for (var i = 0; i < totCardFundings; i++) {
        thisRecord = dsCardFundings.at(i);
        thisFundingSourceID = thisRecord.FundingSourceID;
         
//------------------------------------------------------------------------------------------------------
//Here's where I need to iterate through the listview and change the values for CardFundingName
//----------------------------------------------------------------------------------------------------
    };
 
//this doesn't work
    //$("#listview-card-fundings").data("kendoListView").refresh();

}
I know I could do a join operation on the server and retrieve the FundingSourceName that way, but I'm trying to minimize the load on the server, and since the FundingSources will be static all day, I'd rather the mobile app do that work. Also, as vendors add purchases against the various FundingSource AvailableBalances, I'm going to need to update the listview programmatically to reflect what's left in the till for each FundingSource, so no matter what, I'm going to need to update the UI for them. Is there a way to access the listview and update record items programmatically? Thanks, Mike
Petyo
Telerik team
 answered on 02 May 2012
1 answer
66 views
I have a inserted one tabstrip when I click one detail.

But when I clicked on the next detail, the tabstrip is added to the previous row instead of the current one?

Is there a method to target the tabstrip adding dynamically to the current selected row/detail??

                    var tabstrip = $(".tabstrip").data("kendoTabStrip");
                    var nextItem = tabstrip.select().next();              
                    if (!nextItem.length) {
                        tabstrip.insertAfter({ text: 'metadata', contentUrl: URL }, tabstrip.tabGroup.children("li:last"));                                       
                        tabstrip.select(tabstrip.tabGroup.children().first());       
                    }
George
Top achievements
Rank 1
 answered on 02 May 2012
5 answers
254 views
I originally had a listview with a hard coded list and the layout was fine.  I changed it to use a datasource and template instead and now gaps appear between the list items.  Can anyone suggest why this is and how to remove these?

original code which displays no gaps:

    <div data-role="view" data-title=" Control Panel - Mobile" id="listmessages" data-init="listMessagesInit">
        <h2>Customer Messages</h2>
        <p><?php echo $unread_messages . ' - unread messages'; ?></p> <a data-align="right" data-role="button" id="markasread">Mark as read</a><a data-align="right" data-role="button" id="delete">Delete</a>
        <ul id="message_list">
        <li class="isnew_1" id="890"><a href="/messages/view/890">
       <div style="float:left; width:150px; height: 50px">customer name<br />date</div>
       <div style="height: 50px"id="message_#= id #">customer name</div>
   </a></li><li class="isnew_0" id="234"><a href="/messages/view/#= id #">
       <div style="float:left; width:150px; height: 50px">customer name<br />date</div>
       <div style="height: 50px"id="message_#= id #">customer name</div>
   </a></li><li class="isnew_0" id="456"><a href="/messages/view/#= id #">
       <div style="float:left; width:150px; height: 50px">customer name<br />date</div>
       <div style="height: 50px"id="message_234">customer name</div>
   </a></li>
        </ul>
    </div>
 
<script>
 
     function listMessagesInit(){
         $("#message_list").kendoMobileListView({
              style: "inset",
          });
     }
    </script>


amended code which displays gaps:

<div data-role="view" data-title="Control Panel - Mobile" id="listmessages" data-init="listMessagesInit">
        <h2>Customer Messages</h2>
        <p><?php echo $unread_messages . ' - unread messages'; ?></p> <a data-align="right" data-role="button" id="markasread">Mark as read</a><a data-align="right" data-role="button" id="delete">Delete</a>
        <ul id="message_list"></ul>
    </div>
 
   <script id="message_list_template" type="text/x-kendo-template">
<li class="isnew_#= isnew #" id="#= id #"><a href="/messages/view/#= id #">
       <div style="float:left; width:150px; height: 50px">#= customer_name #<br />#= created #</div>
       <div style="height: 50px"id="message_#= id #">#= message #</div>
   </a></li>
</script>  
 
 function listMessagesInit(){
 
        var messageDataSource = new kendo.data.DataSource({
            
            transport: {
                read: "/messages/data",
                dataType: "json",
            schema: {
              model: {
                  id: "id",
                  fields: {
                      created: { type: "string" },
                      message: { type: "string" },
                      customer_name: { type: "string" },       
                      isnew: { type: "string" }
                     }
                      
                 }
             },
                  
           });
 
          $("#message_list").kendoMobileListView({
              dataSource: messageDataSource,
              //pullToRefresh: true,
              //appendOnRefresh: true,
              style: "inset",
              template: $("#message_list_template").text()
          });
 }


If I change the li's to divs this works layout wise but then the links within the divs will not work as remote view navigation.  Please advise..
Dimo
Telerik team
 answered on 02 May 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
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
SPA
Filter
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
OrgChart
TextBox
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
Popover
DockManager
FloatingActionButton
TaskBoard
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
TimePicker
DateTimePicker
RadialGauge
ArcGauge
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?