Telerik Forums
Kendo UI for jQuery Forum
1 answer
746 views

The first time a value is chosen from my dropdownlist it will display "object Object". After selecting an item a second time, it correctly displays. I've tracked the offending line down to binder.js:

 isObservableObject = this._valueIsObservableObject

The first time through it is incorrectly (?) marked as an observable object so a complex object is set as the value. 

Demo: http://dojo.telerik.com/oreve

Changing POA for an item that is not null works. Changing POA for the empty line shows object Object.

Georgi Krustev
Telerik team
 answered on 12 Sep 2015
7 answers
716 views
Is there any way to automatically resize the width of the column so you can see the whole data when you double click on the resize cursor?

I know you can drag the resize pointer to the width you want, but I would like to set the optimal size in order to see everything when the user double clicks on it. Is that possible?

Thanks,
Nikolay Rusev
Telerik team
 answered on 12 Sep 2015
9 answers
375 views
I'm using 4 views in a tab interface.   Content in each view sometimes changes in length because of dynamic content.    

The problem I have is that sometimes when moving around the content will get stuck in a scrolled position and I can't scroll back up to the top.

I can't duplicate this in the browser but only happens inside phonegap.

Anyone have any ideas or tips?

Thanks.
Alexander Valchev
Telerik team
 answered on 12 Sep 2015
3 answers
70 views

Hi, 

I'm having trouble with the columns.locked attribute in kendo Grid. I have an angular grid that is grouped and uses a groupHeaderTemplate. In the template, I put the value through an angular expression (e.g. from id get the entity name). This all works fine, until I try to freeze a column (any of them), as soon as I set locked: true in any column in the grid, the angular expression is not evaluated.

See the grid in action: http://dojo.telerik.com/AsopA

Thanks in advance for any help.

 A

 

Kiril Nikolov
Telerik team
 answered on 12 Sep 2015
2 answers
755 views

Hi there,

I've got a number of grids working fine in my application, but the most recent one is giving me this error when I try and sort columns :-

 "This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet"

The page loads fine, but it happens when I try and sort a column.  The grid has one fixed column (this sorts fine) and a number of dynamically generated columns (the sorts on these don't work).  The dynamically generated columns are populated on the databound event in jQuery, hence populating the dynamic columns.

Here is my view code :-

@(Html.Kendo().Grid<TEAMSPortalV2.Models.PortalUserTrainingViewModel>()
    .Name("grid")
    .Columns(columns => {
        columns.Bound(p => p.Details).Hidden();
        columns.Bound(p => p.PortalUserID).Hidden();
        foreach (TEAMSPortalV2.Models.MyColumnSettings col in Model.GridColumns)
        {
            if (col.PropertyName == "PortalUser")
            {
                columns.Bound("PortalUser").Title(col.Title);
            }
            else
            {
                columns.Bound("").Title(col.Title);
            }
        }
    })
    .Sortable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .Model(model => {
            model.Id(p => p.PortalUserID);
            foreach (TEAMSPortalV2.Models.MyColumnSettings col in Model.GridColumns)
            {
                if (!col.Editable) {
                    model.Field(col.PropertyName, col.ColType).Editable(false);
                }
            }
        })
        .Read(read => read.Action("GetPortalUserTrainings", "Training"))
    )
    .Events(events => events
        .DataBound("onDataBound_portalUserTraining")
    )
)

I tried modifying the controller to allow get - this allowed the request to be processed but instead it just drew the raw JSON of the response onto the screen rather than loading it into the grid.

Do you know how I can fix this?  Or if there is a client-side way of sorting that doesn't have this issue, instead that would also be an acceptable solution too.

Thanks, Mark

Mark
Top achievements
Rank 1
 answered on 11 Sep 2015
1 answer
55 views

HI in kendo grid page change event,If we keep ajax call,pagination first time only working.After that not at all working.Kindly provide the solution.Below is my code

 

var grid = $("#xmlgrid").data("kendoGrid");
              
                var pager = grid.pager;
                pager.bind('change', test_pagechange);
                
                var pageSizeDropDownList = grid.wrapper.children(".k-grid-pager").find("select").data("kendoDropDownList");
                pageSizeDropDownList.bind('change', test_pagesizechange);

                function test_pagechange()
                {
                    var curr_pageno = grid.dataSource.page();
                    var curr_pagesize = grid.dataSource.pageSize();
                    var localxmldetails = [];
                    if (curr_pageno == 1)
                    {
                        alert("page 1 is clicked");
                        
                        localxmldetails = common_1stpage_dropdownchange();
                        
                        bindingToDatasource(localxmldetails);
                        //alert(JSON.stringify(localxmldetails));
                        //mainxmldetails = localxmldetails;
                        //alert(JSON.stringify(mainxmldetails));

                    }
                    else
                    {
                        $.ajax({
                            type: "GET",
                            url: "/WC3/Resources/XML/ClientDetails.xml",
                            dataType: "xml",
                            async:false,
                            success: function (xml) {

                                var i = 0, ClientID, ClientName, AppDesc, WC3ClientKey, startval, endval;

                                startval = (curr_pageno - 1) * (curr_pagesize) + 1;
                                endval = (startval + curr_pagesize) - 1;
                                $(xml).find('Values').each(function () {

                                    i++;

                                    if (i >= startval && i <= endval) {
                                        localxmldetails.push({ ClientID: $(this).find('ClientID').text(), ClientName: $(this).find('ClientName').text(), AppDesc: $(this).find('AppDesc').text(), WC3ClientKey: $(this).find('WC3ClientKey').text() })
                                    }
                                    else {
                                        if (i < tp) {
                                            return true;
                                        }
                                        else
                                            return false;
                                    }
                                });
                                
                                //alert(JSON.stringify(xmldetailsLocal));
                            }

                        });
                        bindingToDatasource(localxmldetails);
                    }
                }​

Petyo
Telerik team
 answered on 11 Sep 2015
1 answer
304 views

Hello,

I want to use one DataSource for different components like pie charts, bar charts and grids. So, if I set a filter on my UI all displayed widgets would refresh.

Example DataSource:

var dataSource = new kendo.data.DataSource({
  data: [
    {project: "Project A", budget: 700, task: "Task A"},
    {project: "Project A", ​budget: 50, task: "Task ​B"},
    {project: "Project ​B", ​budget: 250, task: "Task ​C"}
  ]
});

A pie char​t ​may display the total budget for each project. The chart would show the following data: Project A - 75%; Project B - 25%.

A bar chart may display the budget for each task. The data would be: Task A - 700, Task B - 50, Task C - 250.

And a grid may display the ​raw data without grouping ect.

My problem is that the DataSource seems not to fit this requirement, because a grouping and aggregation for the pie chart seems not to be possible. Is the DataSource designed to be shared among different modules? I want to avoid coding grouping, aggregation and filtering on my own, because the widget I am developing must provide much more components than pie chart, bar chart and grid with different filters and grouping the end user should attach/detach.

Rosen
Telerik team
 answered on 11 Sep 2015
3 answers
141 views
Hello Guys,
I have minified my example. I have some views with its viewmodel and globals. 
Here is a part of my view: 

     
<div>
<div id="UrlIndex" align="center" class="v-center">
                    <label for="icon-right">
                        <h4>Enter the URL</h4>
                    </label>
                    <span class="k-textbox k-space-right" style="width:70%" >
                        <input class="k-textbox" type="text" id="icon-right"  data-bind="value: url" />
                        <a href="#" class="k-icon k-i-search"></a>
                    </span>
                </div>
            </div>


 Here is the viewModel for this View:

(function () {
    var app;
 
    window.Books = kendo.observable({
       url:"type ur URL",
        data: new kendo.data.DataSource({
            transport: {
                read: this.get("url")
                   
                 
            },
        schema: {
            data: "books"
        }
    }),
        
        test: function(){
             
        }
         
    });
   kendo.bind($("#UrlIndex"), window.Books);
     
 
    document.addEventListener("deviceready", function () { 
        navigator.splashscreen.hide();
 
     
        app = new kendo.mobile.Application(document.body,{layout: "main-layout"});
    }, false);
 
    window.app = app;
}());


This is the way i did the namespace and the viewmodel. Is there a better way to do this ? And another problem is that the binding to the view of
kendo.bind($("#UrlIndex"), window.Books);
only works if it is inside the device-ready function. Can you tell me what is the right, efficient and common way to do this. Can u give an example how to works with namespaces and observables. If I wrap the document ready function at the beginning it still is not binding. 


Another problem is this:
read: this.get("url")


It doesnt get the url, how is the right way. Thank you.
Dimo
Telerik team
 answered on 11 Sep 2015
1 answer
284 views

I've seen a few samples on fetching data from Web API for MVVM with Kendo UI, but I see almost NO examples on how to post data properly to ASP.NET Web API.  I saw an example where you guys said that you need to post an Array of items to Web API, but I'm not sure how old/accurate that is.  Do you have any samples of how I can take an Edit form and Post Data to ASP.NET Web API.  When I go to my Edit Page, I am using the Kendo.DataSource to retrieve the Model from the server, but I'm not sure how to post it back.(clientside JavaScript and what does the Web API expect from the client).

Thanks

Rosen
Telerik team
 answered on 11 Sep 2015
1 answer
272 views

my grid data come from angular http service, but I want to display the detail template for every record as a pop up and how to pass the id of the record to the detail template pop up, and by the way i don't show the id in the grid as a column, it's in the data but not shown.

<kendo-grid
k-options="voters.gridOptions"
k-ng-delay="voters.gridOptions">
</kendo-grid>

 

vm.gridOptions = {
dataSource: {
type: "json",
serverPaging: true,
serverSorting: true,
serverFiltering: true,
pageSize: 13,
transport: {
read:
function (e) {
query.page = e.data.page;
data.getResults(query).
then(function (data) {
e.success(data);
});
}
},
schema: {
data: function(e) {
return e.data.data.data;
},
total: function(e) {
return e.data.data.total;
}
}
},
columns: [
{ field: "full_name", title: "​Name" },
{ field: "birth_date", title: "​Birthdate" },
{ field: "profession", title: "Profession" },
],
pageable: true
};

Kiril Nikolov
Telerik team
 answered on 11 Sep 2015
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?