Telerik Forums
Kendo UI for jQuery Forum
2 answers
138 views
Check out the example: http://jsbin.com/yagihuwe/1/edit

When the following code was commented:

$('#grid tbody').kendoSortable({
  axis:"y",
  change : function(e){
    var data = $('#grid').data('kendoGrid').dataItem(e.item);
  }
});

Change the selection of the grid row, then the name at grid bottom will be updated automatically, but when we enable the above code, and select different rows, the name just don't change. It seemed that the event was stopped by sortable widget. Any suggestions?
hustcer
Top achievements
Rank 1
 answered on 08 May 2014
1 answer
119 views
Hello,

here's what I am trying to achieve:

I have a mobile web app using a  kendo grid on a page.
One of the columns has a template something like : "<a href='##' onclick='someViewmodel.rowClicked(#:someValue#);'''

When the hyperlink is clicked the app is supposed to navigate to a specific mobile view. Instead of doing this it navigates to the home page.
Normally when I trigger anything from a mobile grid I have to do an e.preventDefault() in order to stop unwanted behaviour and then everything works as expected.

In this case however I cannot do that as I do not have the event. If I try to use an mvvm binding inside the template, it does not work as it looks the mvvm bindings happen before the template is rendered. So if I try to do an data-bind="click: run" then it is completely ignored.

how can I stop the default grid behaviour so that the app navigates to the right place ? 

Fiddle Example

Rosen
Telerik team
 answered on 08 May 2014
10 answers
1.1K+ views
I am trying to use a Masked Input in a Kendo Template.  Can I do so, or do I need it outside of the template?  How do I do this?  Thanks.

<script id="popup_editor" type="text/x-kendo-template">
                <div class="k-edit-label">
                <label for="EmpID">Employee ID</label>
            </div>
 
            <input type="text" name="EmployeeID" data-type="number" data-bind="value:EmpID" data-role="numerictextbox" />
 
            <div class="k-edit-label">
                <label for="FirstName">First Name</label>
            </div>
 
                <input type="text" class="k-input k-textbox" name="FirstName" data-bind="value:FirstName">
            <!-- drop down list editor for field: "FirstName" -->
 
                 
            <div class="k-edit-label">
                <label for="LastName">Last Name</label>
            </div>
            <!-- textbox editor for field: "LastName" -->
            <!-- field: "LastName" is not included as a grid column -->
            <input type="text" class="k-input k-textbox" name="LastName" data-bind="value:LastName">
             
            <div class="k-edit-label">
                <label for="DOB">DOB</label>
            </div>
            <!-- datepicker editor for field: "DOB" -->
            <input type="text"
                name="DOB"
                data-type="date"
                data-bind="value:DOB"
                data-role="datepicker" />
                 
            <div class="k-edit-label">
                <label for="Phone">Phone</label>
            </div>
            <!-- numeric textbox editor for field: "Age" -->
            <input type="text" class="k-input k-textbox" name="Phone" data-bind="value:Phone">
            </input>
            #<script type="text/javascript">#
            #    jQuery(function () {#
            #        $("#Phone").mask("(999) 999-9999");#
                });
            #<\/script>#
 
 
            <div class="k-edit-label">
                <label for="LocationPicker">Locations</label>
            </div>
 
 
            <input name="LocationPicker"
            data-bind="value:LocID"
            data-value-field="Value"
            data-text-field="LocID"
            data-source="filteredLocationDataSource"
            data-role="dropdownlist" />
             
            <!--textarea id="editor" rows="10" cols="30" data-bind="value:Comments"></textarea>
            <input type="text" name="Comments" data-bind="value:Comments" />-->
 
    <div class="k-edit-label">
                <label for="Modified">Modified</label>
            </div>
            <!-- datepicker editor for field: "DOB" -->
            <input type="text"
                name="Modified"
                data-type="date"
                data-bind="value:Modified"
                data-role="datepicker" />
 
    <div class="k-edit-label">
                <label for="ModifiedBy">Modified By</label>
            </div>
            <!-- datepicker editor for field: "Modified By" -->
            <input type="text" name="ModifiedBy" data-type="number" data-bind="value:ModifiedBy" data-role="numerictextbox" />
        </script>
Atanas Korchev
Telerik team
 answered on 08 May 2014
1 answer
329 views
Hi,
I would like to know if it is possible to switch the bing layer in the kendoMap control to display the
satellite Images of bing.
If it is possible then how can I do it ?

Markus
T. Tsonev
Telerik team
 answered on 08 May 2014
12 answers
1.2K+ views
Tried to implement the same in ASP.NET MVC 4 Application . 
Followed all steps but it keeps throwing an error "Object doesn't support property or method 'kendoGrid'". Infact even a DatePicker doesnt work. 

http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/ajax-binding

This is what I have included in the site.Master. The 

        <link href="/Content/KendoUI/kendo.common.min.css" rel="stylesheet" />
        <link href="/Content/KendoUI/kendo.default.min.css" rel="stylesheet" />
        <script src="/Scripts/KendoUI/jquery.min.js"></script>
        <script src="/Scripts/KendoUI/kendo.web.min.js"></script>
        <script src="/Scripts/KendoUI/kendo.aspnetmvc.min.js"></script>

and included the following n index.aspx
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
     <%: Html.Kendo().Grid<KendoUISamples.DataProviders.Product>()
      .Name("grid")
      .DataSource(dataSource => dataSource // Configure the grid data source
          .Ajax() // Specify that ajax binding is used
          .Read(read => read.Action("ProductsRead", "Home")) // Set the action method which will return the data in JSON format
       )
      .Columns(columns =>
      {
          // Create a column bound to the ProductID property
          columns.Bound(product => product.ProductID);
          // Create a column bound to the ProductName property
          columns.Bound(product => product.ProductName);
          // Create a column bound to the UnitsInStock property
          columns.Bound(product => product.UnitsInStock);
      })
%>
</asp:Content>

Contents of BundleConfig.cs
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                        "~/Scripts/jquery-ui-{version}.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
                        "~/Scripts/jquery.unobtrusive*",
                        "~/Scripts/jquery.validate*"));

            // Use the development version of Modernizr to develop with and learn from. Then, when you're
            // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/modernizr-*"));

            bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));

            bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(
                        "~/Content/themes/base/jquery.ui.core.css",
                        "~/Content/themes/base/jquery.ui.resizable.css",
                        "~/Content/themes/base/jquery.ui.selectable.css",
                        "~/Content/themes/base/jquery.ui.accordion.css",
                        "~/Content/themes/base/jquery.ui.autocomplete.css",
                        "~/Content/themes/base/jquery.ui.button.css",
                        "~/Content/themes/base/jquery.ui.dialog.css",
                        "~/Content/themes/base/jquery.ui.slider.css",
                        "~/Content/themes/base/jquery.ui.tabs.css",
                        "~/Content/themes/base/jquery.ui.datepicker.css",
                        "~/Content/themes/base/jquery.ui.progressbar.css",
                        "~/Content/themes/base/jquery.ui.theme.css"));

I have wasted close to a week. Please let me know what are the basic js / css files we need to include. 

Prashant
Top achievements
Rank 1
 answered on 08 May 2014
1 answer
163 views
i have drop down list in grid popup editor. It works ok for update. But when i click on Add new record it gives me error "TypeError:language is null. Error is returned due to template applied in Grid Columns to show value in grid. I want to use condition some thing like tha
columns: [
                   { field: "contactId",title: "ContactId", hidden: true },
                   { field: "businessName", title: "Business Name", width: 200 },
                   { field: "firstName", title: "Contact Title", width: 200 },
                   { field: "lastName", title: "Last Name", hidden: true },
                   { field: "language", title: "Language", width: 100, editor: langDropDownEditor,template: "#if(language!=null){=language.value}#"},
                   { field: "country", title: "Country", width: "100px", editor: countryDropDownEditor },
                   { field: "address", title: "Address", hidden: true },
                   { field: "city", title: "City", width: 100 },
                   { field: "gsm", title:"GSM",hidden: true },
                   { field: "email",title:"Email", hidden: true },
                   { field: "isActive",title:"Active", hidden: true },
                   { command: ["edit", "destroy"], title: " ", width: "160px" },
               ],
t
But it gives me error.
Please help me to solve this issue
Saima
Top achievements
Rank 1
 answered on 08 May 2014
2 answers
184 views
I'd like to set the following Grid property via data attribute initialization.

http://docs.telerik.com/kendo-ui/api/web/grid#configuration-pageable.messages.display

So I've added the following attribute but it doesn't seem to work.

data-pageable="messages: { display: 'Showing {0}-{1} of {2} leads' }"

Is it possible to set this property via attributes?
RES
Top achievements
Rank 1
 answered on 07 May 2014
2 answers
3.9K+ views
Hi, can someone show me the proper syntax for multiple if else-if, else statement inside the ClientsideTemplate of the Kendo Grid?

This is a snippet from where my code is breaking (I think....)

columns.Bound(d => d.FileExtension).ClientsideTemplate(
   
"# if (FileExtension == true) { #" +
"<img src='pdf.png' alt='' />" +
"# } else if (FileExtension == '.docx') { #" +
"<img src='word.png' alt='' />" +
"# } else { #" +
"<div> </div>" +
"# } #"
)

The code breaks and getting errors on kendo.all.min.js file. So, I'm not even really sure if my syntax is correct to begin with... =) Thanks very much and I look forward to the response.


Romel
Romel
Top achievements
Rank 1
 answered on 07 May 2014
4 answers
159 views
Hi,

We're having some strange problems when filtering a Data Source used on a chart, AFTER changing the series type.

Here's a link reproducing the issue:
http://trykendoui.telerik.com/uloR

After the timeout functions, the chart should be columns, right?
Are we doing something wrong?

Thanks in advance.
Iliana Dyankova
Telerik team
 answered on 07 May 2014
3 answers
481 views
Observable objects (models) are a really good piece of software. I don't know if I'm missing something, but maybe they lack something in functionalities...
I try to explain it with an example.
Let's suppose I want to insert/edit a complex (db) object. I have a controller that initializes a new instance of a (ASP.NET MVC) ViewModel object, passing it to the View, and sending the resulting HTML to the client.
In the client, I want to use the good (Telerik) MVVM support (I find very useful its services) so I initialize a local js object with something like:

kendo.init(document.body);
model = @(Html.Raw(new JavaScriptSerializer().Serialize(Model)));
vm = kendo.observable(model);
kendo.bind(document.body, vm);

That means that starting with my original C# object I create an equivalent js (observable) object that contains the same values, that I can use to bind local controls to it (examples for this are good enough in the site).

The user edits data, writes what he wants, and then, at last, needs to send these data to the server.
I know that I can do something like this:

var o = vm.toJSON();

$.post({
    url: '@(Url.Action("Action", "Controller"))',
    type: 'POST',
    contentType: 'application/json; charset=utf-8',
    data: JSON.stringify(o),
    success: function (response) {
        alert('OK');
    },
    error: function (e) {
        alert('KO');
    }
});

In this way, I can have on the server (letting infrastructure recreating it) the (C#) ViewModel, so it's really that easy to use that data: it's an instance of the ViewModel I sent to the View, so MVVM support is totally transparent (and this is a wonderful advantage).
The problem is: this is a post, so there is not a page refresh: specifically, I cannot use the ModelState support to show errors...
In the server I have something like:

if (<something wrong>)
    ModelState.AddModelError("Field", "Bla Bla");

but to let ASP.NET MVC infrastructure handle this correctly, I would have to submit the 'normal' form: even in that case, what I would like to submit, as data, would be the serialized version of the MVVM observable object, and not the form fields (maybe I have much more information in the object, than what I display/edit with controls...). Without this support, I don't know if the whole infrastructure is really usable, so I think there must be a key I didn't find...

Anyone ever thought about this? What am I missing?

Thanks as always in advance for your wonderful support.
Andrea Bioli

Petur Subev
Telerik team
 answered on 07 May 2014
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
Drag and Drop
Application
Map
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
DropDownTree
ListBox
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
Licensing
PivotGridV2
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
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?