Telerik Forums
Kendo UI for jQuery Forum
0 answers
229 views
Hello...I'm using the Razor syntax for creating my pie chart and am having problems figuring out how to explode a slice using a databound pie chart. Here is the code that I thought would work...the object that is feeding the Pie has 2 attributes: Label holds the name and Value holds the value.
@(Html.Kendo().Chart<InfoSource.Requests.Models.Graph>()
                            .Name("myallocation")
                            .Title(title => title
                                .Text("MY ALLOCATION")
                                .Font("16px Oswald")
                            )
                            .Theme("Silver")
                            .Legend(legend => legend
                                .Visible(false)
                            )
                            .ChartArea(chartArea => chartArea
                                .Background("transparent")
                            )
                            .DataSource(ds => ds
                                .Read(read => read.Action("dMyAllocation", "Dashboard", new { area = "InfoSource.Metrics" }))
                            )
                            .Series(series => {
                                series.Pie(model => model.Value, model => model.Label, null, model => model.Label == "Unassigned" ? true : false)
                                    .Labels(labels => labels
                                        .Template("${dataItem.Label}")
                                        .Visible(true).Position(ChartPieLabelsPosition.InsideEnd)
                                    );
                            })
                            .Events(events => events
                                .SeriesClick("myallocationClick")
                            )
                            .Tooltip(tooltip => tooltip
                                .Visible(true)
                                    .Template("${dataItem.Label} - ${value}%")
                            )
                            .HtmlAttributes(new { style = "max-height: 300px;" })
                        )

From what I can understand, the series syntax includes on option for true/false if the pie should explode or not. I have set mine up using the Label text so that if the Label text is "Unassigned", the pie piece should explode. This is not happening however.

Can you let me know if my syntax is correct or not? Thanks.
Philip Senechal
Top achievements
Rank 1
 asked on 04 Sep 2012
0 answers
257 views
Hi,
I'm very new to the MVVM framework and I'm running into problems with the grid.  If I set a static height for the grid the content area including the scroll bar does not respect the height.  The outline of the grid is correct.  I thought at first it was an issue with the parent div being set to display:none but I removed that and it still happens.  When I first load my grid it is loading one record and the scroll bar appears just slightly larger than that 1 row.  When I click the checkbox above it forces it to load 3 records and the content area/scroll bar remain at the same height and you can scroll it.  If I remove the static height the grid grows as more records are loaded which make the scroll bar useless because the grid is always showing all the records loaded. I have attached a couple of screen shots.  Am I the only one having this issue?

Thanks for any help that can be provided,
Casey


This is a single page app so each page starts off as it's own Div
<div id="CustomerListPage" style="min-width: 500px">
    <div style="width: 600px; margin-left: auto; margin-right: auto; text-align: right">Include Inactive?<input id="IncludeInactiveCheckBox" type="checkbox" data-bind="checked: includeInactive, events: {click: includeInactiveChanged}" /></div>
    <div id="CustomerListGrid" style="width: 600px; height:300px; margin-left: auto; margin-right: auto; margin-top: 10px" data-role="grid" data-selectable="row" data-columns='[{"field":"id", "title":"ID", "width":50}, {"field":"FullName", "title":"Name"}, {"field":"MailingAddressCity", "title":"City", "width":150}, {"field":"MailingAddressState", "title":"ST", "width":50}]' data-bind="source: customers"></div>
</div>


Here is the view model that controls that page
var CustomerListViewModel = kendo.observable({
 
    // properties
    customers: [],
    includeInactive: false,
        
    includeInactiveChanged: function (val) {
        this.load();
    },
     
    load: function () {
        var self = this;
 
        var dto = new DTO(true, '', new Object({ includeInactive: this.get("includeInactive") }));
 
        $.ajax('SysUserWebService.asmx/GetCustomerList', {
            data: JSON.stringify({ dto: dto }),
            type: 'post', contentType: 'application/json',
            success: function (result) {
                if (result.d.success) {
                    self.set('customers', result.d.payload);
                } else {
                    alert(result.d.message);
                };
            }
        });  
    }   
});

My binding occurs with the page's hash change
// routes the application based on hash changes
var HashChange = function () {
    HideAllPages();
 
    var query = location.hash.split("?");
    var hash = query[0];
 
    switch (hash) {
        case '':
            location.hash = '#MainMenu';
            break;
        case '#MainMenu':
            $('#MainMenuPage').show();
            break;
        case '#CustomerList':
            $('#CustomerListPage').show();
            kendo.bind($('#CustomerListPage'), window.CustomerListViewModel);
            window.CustomerListViewModel.load();
            break;
        case '#CrewList':
            $('#CrewListPage').show();
            break;
        case '#History':
            $('#HistoryPage').show();
            break;
    };
 
};
Casey
Top achievements
Rank 1
 asked on 04 Sep 2012
0 answers
118 views
duplicate of another post
sorry 
David OBrien
Top achievements
Rank 1
 asked on 04 Sep 2012
2 answers
119 views
I was playing around creating a template and came across this problem.  The template has two element, first with data-role of numeric text box, the second with grid.  The first element binds correctly, but the grid does not show up. 

I created a jsFiddle that demonstrates the behavior.  I had also tried making the items array an observable with no luck.

Phil
Top achievements
Rank 1
 answered on 04 Sep 2012
0 answers
121 views
I have a grid setup with one of the columns as : {title:"First Name", field:"FIRST_NAME", sortable:true}

When I drag this column up to the "grouping" section, it displays as "First Name" which is expected. Now if I add the option "hidden:true" to the above column and set a default grouping on this field, it displays "FIRST_NAME" instead. Is there something I'm missing to get hidden columns that are in a default grouping to display as their title and not the actual field ?
Jeremy
Top achievements
Rank 1
 asked on 04 Sep 2012
5 answers
176 views
Here's an example of what I mean. Just open and close the actionsheet several times.
http://jsfiddle.net/RodEsp/r5eCm/

As far as I can tell this behavior can go on forever. I don't know if I'm doing something wrong.

Anyways, I noticed that the issue is that the width of the .k-animation-container grows every time it is opened and closed. I think it might have something to do with the "left:" css style that also changes when the container is opened and closed.

An easy way to see this is by opening the actionsheet, right clicking on the title and inspecting the element. Then just find the div with the .k-animation-container class above actionsheet <ul>. As you open and close the sheet you'll see the width of the container grow.

It is possible to fix this by setting .k-animation-container { width:100% !important; height:100% !important; } (In non iOS platforms the height also grows). But this breaks other elements that depend on the .k-animation-container such as comboboxes.

Hope you guys can help me out with this one!
RodEsp
Top achievements
Rank 2
 answered on 04 Sep 2012
9 answers
1.0K+ views
Hi,
I have purchased licensed version of Kendo UI , prior to this I was using the trial version, In the licensed version I just downloaded the kendo.min.js file , can you please guide on how to use this in  my existing application , if I use this in a new project its not showing any of the controls
Donna
Telerik team
 answered on 04 Sep 2012
0 answers
273 views
Hello,

Can anyone confirm the kendoWindow custom action, as shown below, triggers the browser window's popstate event handler?

 $("#window").kendoWindow({
      actions
: ["Custom", "Minimize", "Maximize", "Close"],
      title
: "Window Title"
 
}).data("kendoWindow").wrapper.find(".k-custom").click(function(e) {
      alert
("Custom action button clicked");
      e
.preventDefault();
 
});

It does in my case.  Here's the relevant popstate code:

    
function popStateHandler(e) {
 
    var State = e.state;
 
    if (State != null) {
 
        console.log(State);
 
        switch (State.stateTitle) {
 
            case "Landing Page":
 
                console.log('transitioning to landing page ...');
 
                // show the content div and hide the hide the login panel
                //
                Transitions.PrimaryElementTransitions.HideLoginPanel();
 
                break;
 
            default:
 
                break;
 
        } // end switch ...
 
    } else if (window.processingLogin == true) {
        console.log('Processing login flag is true.');
 
        window.ProcessingLogin = false;
    } else {
        console.log('transitioning to login state ...');
 
        // show the login panel and hide the content div
        //
        Transitions.PrimaryElementTransitions.ShowLoginPanel();
    }
}
 
// Attach the window.history popstate event handler defined above.
//
window.addEventListener("popstate", popStateHandler, false); // end function definition and addEventListener method invocation ...

Thanks,

Dan
Daniel
Top achievements
Rank 1
 asked on 04 Sep 2012
2 answers
1.1K+ views

Kendo Hello Friends Have a grid with inline editing and to 3 drop-down lists. The display and fill the drop-down lists ok. Works but if I want to save changes, so do not get the desired data to the controller? The list the values ​​I need are the IDs of the selected items from the drop! But come on, only the new text of the drop-down lists for the controller.
Here is my code and annexed the image on the controller

function loadTable() {
    var dataSource = new kendo.data.DataSource({
        transport: {
            read: {
                    url: "/Customer/LoadOperatingPictureTable",
                    dataType: "json",
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    data: {}
                },
                update: {
                    url: "/Customer/UpdateAnimalValues",
                    dataType: "json",
                    type: "POST",
                    contentType: "application/json; charset=utf-8"
                },
                parameterMap: function (data, operation) {
                    if (operation !== "read") {
                        return JSON.stringify({ model: data });
                    }
                }
        },
        autoSync: false,
        schema: {
            model: {
                id: "Id",
                fields: {
                    Id: { editable: false, nullable: true },
                    Name: { editable: false },
                    AnimalCount: {
                        type: "number",
                        validation: {
                            required: {
                                message: "Das Feld darf nicht leer sein!"
                            }
                        }
                    },
                    Distributor: { editable: true },
                    Label: { editable: true },
                    Marketer: { editable: true }
                }
            }
        },
        error: function (e) {
            alert(e.status + ' ' + e.statusText);
        }
    });
 
    $("div#operatingPictureTable").kendoGrid({
        dataSource: dataSource,
        scrollable: true,
        sortable: true,
        editable: "inline",
        columns: [
            {
                field: "Name",
                title: "Tierkategorie"
            },
            {
                field: "AnimalCount",
                title: "Anzahl Tiere",
                template: '<div style="text-align: right">#= AnimalCount #</div>',
                width: 80
            },
            {
                field: "Distributor",
                title: "Lieferant",
                editor: onDrpDistributor
            },
            {
                field: "Label",
                title: "Label",
                editor: onDrpLabel
            },
            {
                field: "Marketer",
                title: "Vermarkter",
                editor: onDrpMarketer
            },
            {
                command: "edit",
                titel: " ",
                width: 110
            }
        ],
    });
         
    function onDrpDistributor(container, options) {
    $('<input name="Distributors" data-bind="value:' + options.field + '"/>')
        .appendTo(container)
        .kendoDropDownList({
            dataTextField: "Value",
            dataValueField: "Id",
            autoBind: false,
            dataSource: new kendo.data.DataSource({
                transport: {
                    read: {
                        url: "/Main/GetDistributors",
                        dataType: "json"
                    },
                    schema: {
                        model:{
                            id: "Id",
                            value: "Value"
                        }
                    }
                }
            })
        });
    }
         
    function onDrpLabel(container, options) {
    $('<input name="Distributors" data-bind="value:' + options.field + '"/>')
        .appendTo(container)
        .kendoDropDownList({
            dataTextField: "Value",
            dataValueField: "Id",
            autoBind: false,
            dataSource: {
                type: "json",
                transport: {
                    read: "/Main/GetLabels"
                }
            }
        });
    }
         
    function onDrpMarketer(container, options) {
    $('<input name="Distributors" data-bind="value:' + options.field + '"/>')
        .appendTo(container)
        .kendoDropDownList({
            dataTextField: "Value",
            dataValueField: "Id",
            autoBind: false,
            dataSource: {
                type: "json",
                transport: {
                    read: "/Main/GetMarketers"
                }
            }
        });
    }
}
JanLeu
Top achievements
Rank 1
 answered on 04 Sep 2012
1 answer
197 views
Hello,



I use MVVM style databinding in my templates for the ListView and Grid widget (in case of the Grid I have a template per column).

That works fine, also when switching to edit mode.

The problem is that when I switch back from edit mode to readonly. I can see in the debugger that the template is applied again, but the MVVM binding is not done, so no data is displayed. Using a regular template (no MVVM) would work fine.



(Using Kendo version 2012.1.710)



Regards, Jaap
Jaap
Top achievements
Rank 2
 answered on 04 Sep 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)
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?