Telerik Forums
Kendo UI for jQuery Forum
2 answers
125 views
Hi,

Is it possible to use kendo ui controls with MVC4 WebAPI?

If yes could some please post me an example please

maybe datasouce using MVC4 Web API or best way to use them together.

Thanks,
Clayton
Vesselin Obreshkov
Top achievements
Rank 2
 answered on 12 Aug 2012
3 answers
238 views
With telerik MVVM is this possible? I have a one field that is calculated fine :

BondProceeds: function(){                                       
                                        return this.get("UnderlyingPar") * (this.get("UnderlyingPrice")/100);
                                       },

I then want another attribute that is computed dependent upon this:

TotalAmount: function(){
                                       return this.get("BondProceeds") - this.get("FloaterAmount");
                                        }

I don't get anything in the textbox for Total Amount. Is this possible?
axwack
Top achievements
Rank 1
 answered on 12 Aug 2012
0 answers
77 views
Hi,
I am attempting to use the Editor control as an EditorTemplate for HTML fields in my MVC4 application. The editor will display fine, but for some reason the code will never update and the value always comes back up the Model as null. Any ideas what I am doing wrong?


Here is the code for Edit.cshtml:

<script type="text/javascript">
    $(document).ready(function () {
        $("#Body").kendoEditor();
    });
</script> 
 @using (Html.BeginForm())
        {
            @Html.ValidationSummary(true)
            @Html.HiddenFor(model => model.ID)
@Html.TextAreaFor(model => model.Body, new { style = "width:600px;height:200px" })
                        @Html.ValidationMessageFor(model => model.Body)
}
Bepa
Top achievements
Rank 1
 asked on 12 Aug 2012
4 answers
1.0K+ views
I have columns like following-
 columns: [
                            { title: "Task Id", field:"ProductID", width: "50px" ,template:'<a onclick="OpenTaskInTab(${ProductID})" href="Javascript:void(0);">${ProductID}</a>'},
                            { title: "Task Name", field:"ProductName"},
                            { title: "Budget", field: "UnitPrice", format: "{0:c}", width: "150px" },                            
                            { title: "Units", field: "UnitsInStock", width: "150px" },
                            { field: "Discontinued", width: "100px" },
                            { command: "destroy", title: "&nbsp;", width: "110px"  }],

For the command column I need a diff image and no 'Delete' or any other text. How to achieve that?
Phil
Top achievements
Rank 2
 answered on 11 Aug 2012
1 answer
82 views
How I can use the filter in Ajax??, If you use this as an error*:

Expected primaryExpression

*Sorry for English
@(Html.Kendo()
      .Grid<Partial.Model>()
      .Name("Grid")
           .Columns(columns =>
      {
          columns.Bound(p => p.Id).Hidden(true).ClientTemplate("<span id=\"Id\">#: Id #</span>");
          columns.Bound(p => p.Names);
          columns.Bound(p => p.Another);
      })
       .Sortable()
      .Filterable()
      .DataSource(dataSource => dataSource
                                          .Ajax()
                                          .Read(read => read.Action("Action", "Controller")).Filter(r=>r.Add(a=>a.Id==1)))
 
)
Renier
Top achievements
Rank 1
 answered on 11 Aug 2012
0 answers
108 views
By adding the name value to the input of the this combobox means that it now gets submitted when the form is submitted, this now breaks all my data saves as they validate incomming data against the my model and obviously the input names (elemntName_input) which is now part of kenod, is not part of my model.

is there an option to change turn this off? 
Andre
Top achievements
Rank 1
 asked on 11 Aug 2012
0 answers
133 views
VIEW
.DataSource(dataSource => dataSource
    .Server()
    .Model(model => model.Id(p => p.id))
    .Destroy(excluir => excluir.Action("ExcluirOnOff","Home"))
)


CONTROLLER

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult ExcluirOnOff(int OnOffID)
{
    moneymanagerBDEntities _db = new moneymanagerBDEntities();
    var product = _db.tbl_001.FirstOrDefault(p => p.id == OnOffID);
 
 
    var routeValues = this.GridRouteValues();
     
    if (product != null)
    {
        return RedirectToAction("Index", routeValues);
    }
    return RedirectToAction("Index", routeValues);
}


HELP !
Gilberto
Top achievements
Rank 1
 asked on 11 Aug 2012
0 answers
99 views

I am pretty New to Javascript and jQuery.


I am now just learning to build User Interface and was checking out KendoUI. I must say its amazing. 


I want to have data in a local file on my computer. Access the data and show it in grid/table.


I want to be able to edit and save the data back to the local file using the user interface in the browser.


I am looking at : http://demos.kendoui.com/web/grid/editing.html


Looking at the source, the data is obtained/saved from/to a remote server:


<script>
            $(document).ready(function () {
                var crudServiceBaseUrl = "http://demos.kendoui.com/service",
                    dataSource = new kendo.data.DataSource({
                        transport: {
                            read:  {
                                url: crudServiceBaseUrl + "/Products",
                                dataType: "jsonp"
                            },
                            update: {
                                url: crudServiceBaseUrl + "/Products/Update",
                                dataType: "jsonp"
                            },
                            destroy: {
                                url: crudServiceBaseUrl + "/Products/Destroy",
                                dataType: "jsonp"
                            },
                            create: {
                                url: crudServiceBaseUrl + "/Products/Create",
                                dataType: "jsonp"
                            },
                            parameterMap: function(options, operation) {
                                if (operation !== "read" && options.models) {
                                    return {models: kendo.stringify(options.models)};
                                }
                            }
                        },
                        batch: true,
                        pageSize: 30,
                        schema: {
                            model: {
                                id: "ProductID",
                                fields: {
                                    ProductID: { editable: false, nullable: true },
                                    ProductName: { validation: { required: true } },
                                    UnitPrice: { type: "number", validation: { required: true, min: 1} },
                                    Discontinued: { type: "boolean" },
                                    UnitsInStock: { type: "number", validation: { min: 0, required: true } }
                                }
                            }
                        }
                    });
 
 
                $("#grid").kendoGrid({
                    dataSource: dataSource,
                    navigatable: true,
                    pageable: true,
                    height: 400,
                    toolbar: ["create", "save", "cancel"],
                    columns: [
                        "ProductName",
                        { field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: 150 },
                        { field: "UnitsInStock", title: "Units In Stock", width: 150 },
                        { field: "Discontinued", width: 100 },
                        { command: "destroy", title: " ", width: 110 }],
                    editable: true
                });
            });
        </script>


How can I possibly have this jSON file on my computer and edit/save the data on it.


Any help with a working example shall be hight appreciated.


Thanks,


Praney 

Praney Behl
Top achievements
Rank 1
 asked on 11 Aug 2012
0 answers
161 views

I am pretty New to Javascript and jQuery.


I am now just learning to build User Interface and was checking out KendoUI. I must say its amazing. 


I want to have data in a local file on my computer. Access the data and show it in grid/table.


I want to be able to edit and save the data back to the local file using the user interface in the browser.


I am looking at : http://demos.kendoui.com/web/grid/editing.html


Looking at the source, the data is obtained/saved from/to a remote server:


<script>
            $(document).ready(function () {
                var crudServiceBaseUrl = "http://demos.kendoui.com/service",
                    dataSource = new kendo.data.DataSource({
                        transport: {
                            read:  {
                                url: crudServiceBaseUrl + "/Products",
                                dataType: "jsonp"
                            },
                            update: {
                                url: crudServiceBaseUrl + "/Products/Update",
                                dataType: "jsonp"
                            },
                            destroy: {
                                url: crudServiceBaseUrl + "/Products/Destroy",
                                dataType: "jsonp"
                            },
                            create: {
                                url: crudServiceBaseUrl + "/Products/Create",
                                dataType: "jsonp"
                            },
                            parameterMap: function(options, operation) {
                                if (operation !== "read" && options.models) {
                                    return {models: kendo.stringify(options.models)};
                                }
                            }
                        },
                        batch: true,
                        pageSize: 30,
                        schema: {
                            model: {
                                id: "ProductID",
                                fields: {
                                    ProductID: { editable: false, nullable: true },
                                    ProductName: { validation: { required: true } },
                                    UnitPrice: { type: "number", validation: { required: true, min: 1} },
                                    Discontinued: { type: "boolean" },
                                    UnitsInStock: { type: "number", validation: { min: 0, required: true } }
                                }
                            }
                        }
                    });
 
 
                $("#grid").kendoGrid({
                    dataSource: dataSource,
                    navigatable: true,
                    pageable: true,
                    height: 400,
                    toolbar: ["create", "save", "cancel"],
                    columns: [
                        "ProductName",
                        { field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: 150 },
                        { field: "UnitsInStock", title: "Units In Stock", width: 150 },
                        { field: "Discontinued", width: 100 },
                        { command: "destroy", title: " ", width: 110 }],
                    editable: true
                });
            });
        </script>


How can I possibly have this jSON file on my computer and edit/save the data on it.


Any help with a working example shall be hight appreciated.


Thanks,


Praney 

Praney Behl
Top achievements
Rank 1
 asked on 11 Aug 2012
1 answer
881 views
I'm trying to open a window where content page has uses a template to display the data.
The content page it self works fine just entering the url but when I try to open it as a window nothing happens.
     var window = $("#window");
    
   window.kendoWindow({
        width: "505px",
        height: "315px",
        title: "Mail",
        actions: ["Refresh", "Maximize", "Close"],
        content:"inbox/getemail.aspx?msgid="+msgid,
        iframe:false
    });
 
    window.data("kendoWindow").open();

//content page 
script language="javascript">
 
var messageData;
 
$.fn.getMessageData = function(){
     
    messageData =
    {      
        time:'2012-07-26 12:34:50',
        sender:'test@test.com',
        subject:'Testing message data'     
    };
};
 
$(function(){  
    var template = kendo.template($("#template").html());
    $.fn.getMessageData();     
    $("#preview").html(template(messageData));
        
});
 
</script>
 
<script type="text/x-kendo-template" id="template">
    <h3>#= subject #</h3>
    <h4>posted on #= time # by <strong>#= sender #</strong></h4
</script>
 
 <div id="preview"></div>
John DeVight
Top achievements
Rank 1
 answered on 10 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?