Telerik Forums
Kendo UI for jQuery Forum
2 answers
134 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
252 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
82 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
88 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
116 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
145 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
105 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
175 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
902 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
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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?