Telerik Forums
Kendo UI for jQuery Forum
4 answers
355 views

I have a cshtml page that contains a panelbar with 6 items.  Each item uses Ajax to load content based
on a partial view that contains a grid e.g.:

   @(Html.Kendo().PanelBar()
        .Name("panelbar")
        .ExpandMode(PanelBarExpandMode.Single)
        .Animation(animation =>
            {
                animation.Enable(true);
                animation.Expand(config =>
                    {
                        config.Expand();
                        config.Fade(FadeDirection.In);
                        config.Duration(AnimationDuration.Fast);
                    });
            })
        .Items(panelbar =>
        {
            panelbar.Add()
                .Text(String.Format("{0} [{1} Items]", "One",@Model.MyOpenObligations ))
                .ImageUrl(Url.Content("~/Contents/Images/White_Triangle.png"))                   
                .Encoded(false)
                .Selected(true)
                .Expanded(true)
                .LoadContentFrom("ListFilteredObligations", "MyController");
etc etc................           

The partial view that is loaded by each panel item contains a grid that uses ClientTemplates for specfic columns
e.g. :

@(Html.Kendo().Grid(Model)
    .Name("obligationGrid")
    .Columns(columns =>
        {
            columns.Bound(p => p.ReferenceNumber);
            columns.Bound(p => p.Extract);
            columns.Bound(p => p.Clause);
            columns.Bound(p => p.Party).ClientTemplate("#= Party ? Party.DisplayName : ''# ").Title("Party");
        })
....etc etc

The ClientTemplate columns are rendered OK when the first panel item is expanded (see attached screen shot).
However, when subsequent panel items are expended the grid client template columns display the entire child object (see attached screen shot).We only see this issue when using the grids within the PanelBar control.

Daniel
Telerik team
 answered on 04 Feb 2013
3 answers
301 views
Hi,

In your ASP.NET grid you have a grid select column (GridClientSelectColumn) which is a checkbox to select rows in a grid. This works together with the functionality to select multiple rows using click/ctrl-click. 

For an example see: http://demos.telerik.com/aspnet-ajax/grid/examples/programming/webmailgrid/defaultcs.aspx 

Is this something you are planning to implement in KendoUI? 


Regards,
Jan Erik
Iliana Dyankova
Telerik team
 answered on 04 Feb 2013
5 answers
516 views
When I change a value in the popup editor the dirty flag is not set, hence the data is not posted back.

Run the attached project:
Click Edit on the grid item
Within the popup dialog
Click into the Customer field and Add '5' to the 'Sage 1234' data(Notice the grid dirty(changed) indicator not present)
Click save.(Notice the grid not updated)

Another issue I'm having is the checkboxes in the Subscriptions grid (also on the Edit popup) do not set the dirty flag either. Hence, if I check or uncheck them and then enter subscription text the checkboxes revert back to their original state.

Any help is appreciated.
Petur Subev
Telerik team
 answered on 04 Feb 2013
3 answers
958 views
The datasource for my treeview is defined as follows:

 legends = new kendo.data.HierarchicalDataSource({                   
                 schema: {
                     model: { id : "id", hasChildren: true,  children: "layers"    }
                 }
             });      

and my treeview is initialized like this:

  $("#treeview").kendoTreeView({ 
                 checkboxes : { checkChildren : true },
                 dataSource: legends }); 

This is supposed to be a dynamic data source allowing me to add and remove items during runtime.  When I add and remove items from legends, I expect the treeview to add and remove nodes accordingly.  So when I later create a model like this:

var category = {id : 0, text : "some text", expanded : true, spriteCssClass : "folder", layers : [] }

and add it to the datasource using the add method

                legends.add(category); 

I should expect to see a tree node automatically created.  This works.

If I later grab the category created above from legends.data() and add a child layer like this:

category.layers.push({ id : 1, text : " child",  someOtherData : {} });

I do not see the child appear on the treeview and my application starts behaving abnormally.   Then it occurred to me that the layers collection was not an observable and tried creating my categories like this:

var category = {id : 0, text : "some text", expanded : true, spriteCssClass : "folder", layers : new kendo.data.ObservableArray([]) }

With this change, I still get no children displayed and applpication appears to hang on call to category.layers.push().

What am I missing?

Volodymyr Oliinyk
Top achievements
Rank 1
 answered on 04 Feb 2013
1 answer
139 views
Hello,

I was wondering if it was possible to get the selected element from the DOM when the user selects an item in the list?  I can't find it in the details of the argument...

Thanks.
Georgi Krustev
Telerik team
 answered on 04 Feb 2013
1 answer
147 views
Dynamic data is not appearing in the list. Data is fetched dynamically in jsonp format. When checked in Chrome developer tools i am able to see the response. Please find the code below. Can someone help me here ? 

<!DOCTYPE html>
<html>
<head>
    <title>Pull to refresh</title>
    <script src="../../lib/jquery.min.js"></script>
    <script src="../../lib/kendo.mobile.min.js"></script>
<link href="../../lib/styles/kendo.mobile.all.min.css" rel="stylesheet" />
    <link href="../../lib/styles/kendo.common.min.css" rel="stylesheet" />
</head>
<body>
    <a href="../index.html">Back</a>
    <div data-role="view" data-init="mobileListViewPullToRefresh" data-title="Pull to refresh">
   <header data-role="header">
       <div data-role="navbar">
           <span data-role="view-title"></span>
           <a data-align="right" data-role="button" class="nav-button" href="#index">Index</a>
       </div>
   </header>

   <ul id="pull-to-refresh-listview"></ul>
</div>

<script id="pull-to-refresh-template" type="text/x-kendo-template">
        #= Title #
</script>

<script>
    function mobileListViewPullToRefresh() {
            var dataSource = new kendo.data.DataSource({
                serverPaging: true,
                pageSize: 1,
                transport: {
                    read: {
                        url: "http://localhost/MvcMovieApp/Mobile/RestResponse", // the remove service url
                        dataType: "jsonp" // JSONP (JSON with padding) is required for cross-domain AJAX
                    },
                    parameterMap: function(options) {
alert(kendo.stringify(options));
                    return {
                            q: "javascript",
                            page: options.page,
                            rpp: options.pageSize
                            since_id: options.since_id //additional parameters sent to the remote service
                        };
                    }
                },
                schema: { 
                    data: "movies" // the data which the data source will be bound to is in the "results" field
                }
            });

alert("Before kendoMobileListView");
        
        $("#pull-to-refresh-listview").kendoMobileListView({
            dataSource: dataSource ,
            pullToRefresh: function(){ alert("dataSource"); return true },
            appendOnRefresh: true,
            template: $("#pull-to-refresh-template").text(),
            endlessScroll: true,
            pullParameters: function(item) {
                return {
                    since_id: item.id_str,
                    page: 1
                };
            }
        });
    }
</script>

    <script>
        window.kendoMobileApplication = new kendo.mobile.Application(document.body);
    </script>
</body>
</html>

JSONP which i am receiving is :
({"movies":[{"ID":1,"Title":"Movie 1","ReleaseDate":"\/Date(1355250600000)\/","Genre":"Comedy","Price":10},{"ID":2,"Title":"Movie 2","ReleaseDate":"\/Date(1355250600000)\/","Genre":"Thriller","Price":10}]})
Alexander Valchev
Telerik team
 answered on 04 Feb 2013
1 answer
116 views
I've been trying to get my comboboxes cascading correctly using the guide on the Cascading ComboBoxes page and I think the information there may be incorrect. I wanted to use the approach where I set the parameters manually and copied the code at the very bottom of the page:

$("#child").kendoComboBox({
   cascadeFrom: "parent",
   dataTextField: "childName",
   dataValueField: "childID",
   dataSource: {
       transport: {
           read: {
               url: "",
               data: {
                   parentID: $("#parent").val()
               }
           }
       }
   }
});

This doesn't work, since I believe parentID: $("#parent").val() is interpreted at set up time, rather than when cascading. The correct code for the data portion would be: 
data: function() {
    parentID: $("#parent").val()
}

In the answer there's a reference to the "How it works" section - I couldn't find this, could a link be provided if it still exists? 
Georgi Krustev
Telerik team
 answered on 04 Feb 2013
1 answer
124 views
Hi

I have a search screen, that lists a amount of contacts, when a user clicks on the details button on one of the list items, I want to load another view with the details of the contact.  However I am not even getting data to display.  I am not sure how I can go about troubleshooting this problem.  I have referenced this forum post ListView not working with data-bind but to no avail.

<div data-role="view" id="contactView" data-model="ContactViewModel" data-show="contactShow">
        <h1 id="ContactHallo">Contact Screen</h1>
        <ul id="contactDetailList" data-role="listview" data-style="inset">
        </ul>
</div>
function contactShow(e) {
   ContactViewModel.LoadContacts();
};
<script id="contactDetailtemplate" type="text/x-kendo-template">
    <a href="tel:#:data.MobileNumber#">#:data.MobileNumber#</a>
</script>
var ContactViewModel = kendo.observable({
    ContactId: null,
 
    TestData: [{ AssociatedContactType: "n\/a", AssociatedProperties: [], EmailAddress: "n\/a", FName: "User1", HomeNumber: "n\/a", LName: "LastName", MobileNumber: "+27 21 0823219213", WorkNumber: "n\/a" }],
 
    ContactData: new kendo.data.DataSource.create({ data: this.TestData }),
 
    LoadContacts: function(){
        var templatePart = $("#contactDetailtemplate").text();
        $("#contactDetailList").kendoMobileListView({
            dataSource: this.ContactData,
            template: templatePart,
            endlessScroll: true,
            scrollTreshold: 30
        });
 
    }
});
I have also created a JSFiddle

Thanks
Rihan
Alexander Valchev
Telerik team
 answered on 04 Feb 2013
1 answer
207 views
Hi,

Up to now I have been using local binding but now I need to show a grid using remote binding. I have defined a WCF method that is being called e returns a DataSourceResult. This class was picked from grid-wcf-crud code sample.

public class DataSourceResult
{
    /// <summary>
    /// Represents a single page of processed data.
    /// </summary>
    public IEnumerable Data { get; set; }

    /// <summary>
    /// The total number of records available.
    /// </summary>
    public int Total { get; set; }
}


I have defined the Read function like this:

var properties = { url: url, data: data, type: 'POST', dataType: dataType, contentType: 'application/json', 
                               cache: false, success: OnSuccess, error: OnError };

$.ajax(properties);

Debugging the WCF method I can see that it is being called correctly and the returned data is OK. But I am receiving a 12152  error code in the javascript.

What could it be ?

Thanks in advance
Atanas Korchev
Telerik team
 answered on 04 Feb 2013
1 answer
131 views
Hi,
I can't figure out why my chart is not getting updated, and I think I've tried just about anything.
Here is a snippet:
http://jsfiddle.net/NShJ9/

When I run it in a browser, I get "Error: 'prb' is undefined", which makes no sense to me...

Here is a similar one that works... http://jsfiddle.net/aHFwc/6/
Thank you!
Holger
Top achievements
Rank 1
 answered on 04 Feb 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?