Telerik Forums
Kendo UI for jQuery Forum
4 answers
421 views
I am new to kendo ui and mvvm, and I'm facing this issue:

I'm having a JSON file in the follow format:

    [
    {
    "Id":1,
    "img":"shoes.png"},
    {"Id":2,
    "img":"books.png"}
        }
    ]
I am reading the file using the sample mentioned online by you'll as follows:

    var crudServiceBaseUrl = "pro.json";
        var viewModel = kendo.observable({
                productsSource: new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: crudServiceBaseUrl,
                            dataType: "json"
                        },
                        update: {
                            url: crudServiceBaseUrl,
                            dataType: "json"
                        },
                        destroy: {
                            url: crudServiceBaseUrl,
                            dataType: "json"
                        },
                        parameterMap: function(options, operation) {
                            if (operation !== "read" && options.models) {
                                return {
                                    models: kendo.stringify(options.models)
                                };
                            }
                            return options;
                        }
                    },
                    batch: true,
                    schema: {
                        model: {
                            id: "Id"
                        }
                    }
                })
            });

            kendo.bind($("#form-container"), viewModel);

I am able to bind the data from the data source to a Kendo Control such as a dropdownlist or some other Kendo Control. But when I try binding the data to an HTML Control (mostly an img tag). It stops working and gives an error saying "this.parent" is not a function.

following is the HTML which works:

    Select Product: <select data-role="dropdownlist" data-value-field="Id" data-text-field="img"
                             data-bind="source: productsSource"></select>

However binding to a normal `<img>` tag does not work. In short I need to bind images based on src value to a div using kendo ui mvvm.

Kindly help me out. Thanks!!

-
Hardik
Hardik
Top achievements
Rank 1
 answered on 11 Apr 2013
1 answer
185 views
Hello,

This is an example on how to use Kendo Splitter to build a Web Application Fluid Layout,

It is very simple... It just resize the panes based on the window and outer panes size...

Fluid Web App Layput - DEMO SPLITTER

Maybe Kendo DEVS want to optimize it and put this on Official Demo.

I hope this help you....
ATIYEH
Top achievements
Rank 1
 answered on 11 Apr 2013
1 answer
78 views
I want to use NumericTextBox to input student scores. Most of the time this is numbers. It's easier with tablets.

However we have some special codes that we have to treat.

Like "AB" for Absent, ou "EX", Exemption.  We convert these code to negative numbers, on input/output.

What do you think is the better way to deal with this kind of input with Kendo ? 

Thanks
Dimo
Telerik team
 answered on 11 Apr 2013
1 answer
426 views
This should be simple
My grid gets the data initially as expected but doesn't do anything when the update button is clicked while adding a new record.
@(Html.Kendo().Grid<DepartmentViewModel>()
      .Name("DepartmentsGrid")
      .ToolBar(t => t.Create().Text("New Department"))
      .Editable(editable => editable.Mode(GridEditMode.InLine))
      .Columns(columns =>
          {
              columns.Bound(d => d.Name);
              columns.Bound(d => d.Email);
              columns.Bound(d => d.Phone);
              columns.Command(c => c.Edit());
          }).Filterable().Groupable().Sortable().Pageable()
            .DataSource(datasource => datasource
                .Ajax()
                .Events(events => events.Error("error_handler"))
                .Create("CreateDepartment","Admin")
                .Update("UpdateDepartment","Admin")
                .Model(m=> m.Id(id => id.Id))
                .Read(read => read.Action("DepartmentsGridData", "Admin"))))
My server code is here.
public partial class AdminController
   {
       public ActionResult Departments()
       {
           return View();
       }
 
       public ActionResult DepartmentsGridData([DataSourceRequest] DataSourceRequest request)
       {
           var data = _departmentService.GetDepartments();
           var model = data.ToDataSourceResult(request);
           return Json(model);
       }
       [HttpPost]
       public ActionResult CreateDepartment([DataSourceRequest] DataSourceRequest request,Department department)
       {
           return null;
       }
       [HttpPost]
       public ActionResult UpdateDepartment([DataSourceRequest] DataSourceRequest request,Department department)
       {
           return null;
       }
   }
Any help would be greatly appreciated.
Nikolay Rusev
Telerik team
 answered on 11 Apr 2013
2 answers
371 views
Hello

I'm using KendoUI with ASP.NET. Setting the position of a KendoUI window element is relatively easy, but I'm finding it difficult to get position(top, left) dynamically.

Can it be done? If window is moved from its original position to other, can I somehow read the new coordinates. The information has to be somewhere because positions are know when a window is closed and opened again.

Cheers,
JoonasK
Joonas
Top achievements
Rank 1
 answered on 11 Apr 2013
2 answers
1.8K+ views
My solution requires us to add rows programatically. There is a complication in that the rows need to be added to a subgrid. Looks like it works but the data is now being saved. To test our problem, I have added a button which runs the function below on your grid-odata-crud example which I downloaded from github.

            function AddRow() {
                var productsGrid = $('#grid').data('kendoGrid');
                var dataSource = productsGrid.dataSource;
                dataSource.add({ ProductID: 10002, ProductName: 'A Johns Product 1', UnitPrice: 10.00, UnitsInStock: 5, Discontinued: false });
                dataSource.sync();
                console.log('Done');
            }

Should the above work. No rows are added to the database using this technique although I can add rows in the usual manner via the 'Add new record' button.

Hope you can help.
Sanket
Top achievements
Rank 1
 answered on 11 Apr 2013
8 answers
1.2K+ views
In a kendo grid is it possible to pick and choose which fields from the given model show in the popup form when popup edit mode is enabled (i.e. i have 10 properities in my model that is past to my grid and I only whish to show 5 specific ones)? How would I go about doing this if it is possible.
Almond
Top achievements
Rank 1
 answered on 11 Apr 2013
8 answers
78 views
I am porting an android/iOS kendoui mobile app to wp8. There is a very pronounced what screen that flashes on every navigation. I'm not doing anything special. Has this been reported by others? Is there a fix?
Kenneth
Top achievements
Rank 1
 answered on 11 Apr 2013
1 answer
95 views
Good day,

I want changed the default delete button found on the grid. I want to replace it for an image, is there any way I can do that?

Thank you,

Guillermo Sanchez. 
Guillermo
Top achievements
Rank 1
 answered on 10 Apr 2013
2 answers
74 views
Hi,

I am creating an application which requires a listview with items coming from an external xml datasource.
This is what my datasource looks like:
01.var expenseFormDataSource = new kendo.data.DataSource({
02.        transport: {
03.            read: {
04.                url: EA.baseURL + "resources/expenseService/getExpenseForms",
05.                dataType: "xml",
06.                type: "POST"
07.            },
08.            parameterMap: function(options) {
09.                return {
10.                    token: EA.getToken()
11.                };
12.            }
13.        },
14.        schema: {
15.            type: "xml",
16.            data: "expenseForms/expenseForm",
17.            model: {
18.                fields: {
19.                    id: "id/text()",
20.                    date: "date/text()",
21.                    statusId: "statusId/text()"
22.                }
23.            }
24.        }
25.    });
A preview of the returned XML can be found in attachment.  (I want to create a listitem per expeseFrom).

The listview is created when the view is initalized.  Here is the code:
1.$("#expenseFormList").kendoMobileListView({
2.       dataSource: expenseFormDataSource,
3.       pullToRefresh: true,
4.       template: $("#expenseForm-template").text()
5.   });
The expenseFormList is an empty unordered list inside my view. The expenseFrom-template looks like this:
1.<script id="expenseForm-template" type="text/x-kendo-template">
2.    <a data-role="listview-link" id=#="\"my-expenses-show-pdf-" + id+ "\""#>
3.        <div class="expenseForm-date">#= kendo.toString(new Date(Date.parse(date)), "dd/MM/yyyy") #</div>
4.        <div class="expenseForm-status">Status: #= expenseStatusIdToString(statusId) #</div>
5.    </a>
6.</script>
This all works except when I include "kendo.data.min.js".  When I include the file,  the items in the list are not rendered and no error message is provided in Chrome Developers Tools.  The same issue also occured when I tried to follow the listview with pull-to-refresh tutorial:  no items when the file was included.
I have to include the JavaScript file for a Kendo dropdownlist,  somewhere else in my application.  
What should I do? 
Thanks!

Sander
Top achievements
Rank 1
 answered on 10 Apr 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
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
Iron
Iron
Sergii
Top achievements
Rank 1
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
Iron
Iron
Sergii
Top achievements
Rank 1
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?