Telerik Forums
Kendo UI for jQuery Forum
2 answers
195 views
Hi Everyone,
I'm quite new to Kendo UI Mobile on Icenium, and i'm currently trying to refresh the data i have on my mvvm viewmodel, basically i have a view model with a datasource and a function named showView: wich i would like to be called after the view is presented to the user, i tried seeking on the documentation but i wasen't unable to make raise data-show on my viewmodel. Could any one be so kind to provide me a working example, the viewmodel is created like the one on visual studio sample, with an added showView: function().. 
I need this because i need to load  fresh data from localStorage, do some stuff with it and populate the datasource to show a result on the screen.
 
Thanks
Sebastian
Sebastian
Top achievements
Rank 1
 answered on 30 Oct 2013
1 answer
364 views
Dear All,

I have created the web api and deployed it.in the html page using the kendo Ui

"<head>
    <!-- Common Kendo UI Web CSS -->
    <link href="styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
    <!-- Default Kendo UI Web theme CSS -->
    <link href="styles/kendo.default.min.css" rel="stylesheet" type="text/css" />

    <!-- jQuery JavaScript -->
    <script src="js/jquery.min.js"></script>
    <!-- Kendo UI Web combined JavaScript -->
    <script src="js/kendo.all.min.js"></script>

    <title>Dashboard</title>
</head>
<body>

    <div id="example" class="k-content">

        <div class="grid-wrapper">
            
            <div id="grid"></div>

            <script>
                var remoteDataSource = new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: "http://localhost:2704/api/employee",
                            dataType: "jsonp"
                        }
                    },
                    schema: {
                        model: {
                            id: "Id",
                            fields: {
                                Id: { type: "number" },
                                FirstName: { type: "string" },
                                LastName: { type: "string" }
                            }
                        }
                    }

                });


                $("#grid").kendoGrid({
                    dataSource: remoteDataSource,
                    height: 200
                });

            </script>
        </div>

        <div class="table-wrapper">
            <div id="divResult">
                
                <script>
                    function GetAllProducts() {
                        jQuery.support.cors = true;
                        $.ajax({
                            url: 'http://localhost:2704/api/employee',
                            dataType: 'jsonp',
                            success: function (data) {
                                WriteResponse(data);
                            },
                        });
                    }
                    function WriteResponse(products) {
                        var strResult = "<table><th>ID</th><th>FirstName</th><th>LastName</th>";
                        $.each(products, function (index, product) {
                            strResult += "<tr><td>" + product.Id + "</td><td> " + product.FirstName + "</td><td>" + product.LastName + "</td></tr>";
                        });
                        strResult += "</table>";
                        $("#divResult").html(strResult);
                    }

                    $(document).ready(function () {
                        GetAllProducts();
                    });
                </script>
            </div>
        </div>
    </div>
 
</body>"

im calling the the api the response headers are empty.when i access the api it is working fine.Can anyone help how to intergerate the web api with the Kendo UI html pages.
Atanas Korchev
Telerik team
 answered on 30 Oct 2013
3 answers
134 views
Hi, 
I convert my MVC project to use Kendo UI. I have action result return simple Json object status with message if there is an error. It was working fine before I convert.
now it tries IE tries to download the Json, Firefox and Chrome will show it as text.

here is my code. I add  ("text/html", System.Text.Encoding.UTF8, JsonRequestBehavior.AllowGet) I was hoping it will fix it but it didn't

return Json(new { Success = true }, "text/html", System.Text.Encoding.UTF8,
                        JsonRequestBehavior.AllowGet);


 return Json(new { Success = false, Message = formPost.Message }, "text/html", System.Text.Encoding.UTF8,
                        JsonRequestBehavior.AllowGet);




form 

Ajax.BeginForm(new AjaxOptions { OnSuccess = "handleModalSubmit" })

JS


 function handleModalSubmit(result) {

        if (result.Success) {
            alert("Your request was sent Successfully");
            
        }
        else {
            alert("There was problem sending your request");

        }
    }



Here is my Kendo include files 


<link href="@Url.Content("~/Content/kendo.compatibility.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2013.2.918/kendo.common.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2013.2.918/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2013.2.918/kendo.default.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2013.2.918/kendo.dataviz.default.min.css")" rel="stylesheet" type="text/css" />    <script src="@Url.Content("~/Scripts/kendo/2013.2.918/jquery.min.js")"></script>

<script src="@Url.Content("~/Scripts/kendo/2013.2.918/kendo.all.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/2013.2.918/kendo.aspnetmvc.min.js")"></script>
    <script src="@Url.Content("~/Scripts/kendo.modernizr.custom.js")"></script>
        
Dimo
Telerik team
 answered on 30 Oct 2013
1 answer
72 views
Hi,
There's a bug in scheduler, which can be easily reproduced with your online demos.
- Choose the basic usage demo.
- Doubleclick an event, to get into edit mode
- Change the start Time to 5pm and the end Time to 7pm.
- Save the event.
- Click "show business hours"
As a result, the event is displayed throughout the whole day.
Any chance, to get a fix for that?
Rosen
Telerik team
 answered on 30 Oct 2013
2 answers
448 views
I am using the Multiselect widget along with Kendo MVVM. The tags are stored in an object that is saved to the database, this works fine when creating things.

But when retrieving them is a different story. I can add tags again, that is also fine, but when the item loads in from the database, it won't properly show the existing tag items that belong in the multiselect. So let's say I pull up an item with two tags. . { "Id": "tags/1", "Name" : "C#" }{ "Id" : "tags/2", "Name" : "Kendo UI" } .. these are not persisted into the multi-select box.
$widget = $element.kendoMultiSelect({
    dataTextField: "Name",
    dataValueField: "Id",
    // define a custom template
    dataSource: {
        transport: {
            read: {
                dataType: "json",
                url: $url
            }
        }
    },
    open: function (e) {
        this.list.addClass("tag-cloud");
    },
    close: function (e) {
        //e.preventDefault();
    },
    value: viewModel.get("Tags")
}).data("kendoMultiSelect");
<div style="width: 500px;">
    <h2 class="fg-color-blueDeep">Tags</h2>
    <div class="input-control" data-for="tags">
        <select id="tags" multiple="multiple"
                data-placeholder="Select Tags..."
                class="dark tag-cloud"
                data-bind="value: Tags"
                style="width: 500px;"></select>
    </div>
</div>

Stacey
Top achievements
Rank 1
 answered on 29 Oct 2013
1 answer
140 views
Hi,

I am building a grid with inline editing and custom editors. I am wondering how to set the value of a field in this scenario. I don't think I want to use model.set in the change handler of my control, because I don't want to commit the data until the user clicks the "Save" button. Do I have to handle the save and cancel events myself to commit the entered data to the model (or not in the case of a cancel)? Or is there a built-in way to do this?

Thanks,
Steve
Stephen
Top achievements
Rank 1
 answered on 29 Oct 2013
2 answers
1.7K+ views
Hi,

I am using the e.model.isNew() to change the Title of the popup depending on whether Edit or Save is pressed.
That's working fine, I am however having an issue with then pressing the edit button to the added item.
The pop up is shown but with "Add", not "Edit" as the title.

If I refresh the page then it works as expected.

Code:
function onEdit(e) {
        if (e.model.isNew()) {
            // add
            $(".k-window-title").text("Add");
        } else {
            // edit
            $(".k-window-title").text("Edit");
        }

    }

Is there a way on the save event to specify that the model is no longer new?

    function onSave(e) {
        // set the model no longer as new ??
        
    }
Elliott
Top achievements
Rank 1
 answered on 29 Oct 2013
3 answers
1.9K+ views
Is it possible to remove the grid grouping programmatically? 
Jason
Top achievements
Rank 1
 answered on 29 Oct 2013
5 answers
470 views
I'm using CRUD for my scheduler with an aspx web service.  For the create and update event I am returning the created/updated event with the identifier in the json response, yet it is firing a second time as though something failed.  The response from the service is OK, so I'm not sure what could be causing this. 

What can I look at in the create/update complete event to tell if it added/updated the event?  Or is there a check somewhere in the javascript that if failed will cause it to fire again where I can put a break point and see what is happening?

Thanks.

Cyndie
Top achievements
Rank 1
 answered on 29 Oct 2013
1 answer
790 views
I have a grid that I have added the ColumnMenu to that allows the user to pick which columns they would like to see.  I am creating a "Reset" button that will restore the grid to its original state.  How do I reshow ALL of the columns that are part of the datasource?

I need to somehow have an "ALL" because this grid is being built dynamically and different users will have different columns so I can't hard code the values in here...

Basically I just need to have something like this...

...
var grid = $('#ListAccountsGrid').data('kendoGrid');
grid.showColumn('ALL or *');
...

Anyone have any ideas?
Ignacio
Top achievements
Rank 1
 answered on 29 Oct 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
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?