Telerik Forums
Kendo UI for jQuery Forum
5 answers
408 views
The model defined below on kendo ui datasource strips off the time portion of the StartDate and EndDate when deserialized on client.  I tried setting the model type to "datetime" but that didn't seem to work.  If i remove the model then the time portion is not lost but i have to do ISO date parsing manuallly.  What am i doing wrong?

More info:
I'm using web api controller that returns dates in ISO 8601 format.
schema: {
                  errors: function (response) {
                      return response.errors;
                  },
                  model: {
                      id: "ItemID",
                      fields: {
                          "Subject": { type: "string" },
                          "StartDate": { type: "date" },
                          "EndDate": { type: "date" }
                      }
                  }
              },
Ray
Top achievements
Rank 1
 answered on 11 Oct 2012
8 answers
471 views
I have defined a kendo datasource with transport methods (create, read, update, and destroy), as well as a schema definition:

            var dataSource = new kendo.data.DataSource({
            transport: {
                create: {
                    url: "/api/Prospects",
                    type: "POST"
                },
                
read: "/api/Prospects",
                update: {
                    url: "/api/Prospects",
                    type: "PUT"
                },
                destroy: {
                    url: "/api/Prospects",
                    type: "DELETE"
                }
            },
            schema: {
                model: {
                    id: "ProspectId",
                    fields: {
                        ProspectId: {
                            editable: false,
                            nullable: true
                        },
                        FirstName: { type: "string" },
                        LastName: { type: "string" },
                        EmailAddress: { type: "string" },
                        ProspectTypeId: { type: "number" },
                        ProspectStatusId: { type: "number" }
                    }
                },
                type: "json"
            }
        });

My form elements contain appropriate data-bind attributes to form elements, and I am calling kendo.bind passing the form and datasource as parameters. The goal is that the form is used for both adding and editing records.

I am not sure how to write the code to initialize the form for adding a new record to the datasource.

I've been unsuccessful finding an example to do this on the kendo website. Can you help?

Thanks,
Gary
Ross
Top achievements
Rank 1
 answered on 10 Oct 2012
1 answer
58 views
 this is my code. its hitting server 3 times when page is loaded.
Please give me the solution.

 $("#jobsgrid").kendoGrid({
                        dataSource: {type: "json",
                            serverPaging: true,
                            pageSize: ${pagesize},
                            transport: { read: { url: contextPath + "/ajax/jobs.htm", dataType: "json"} },
                            schema: { data: "data", total: "count" }
                        },
                        resizable: true,
                        scrollable: true,
                        sortable: true,   
                        pageable: true,
                        rowTemplate: kendo.template($("#template1").html())
                    
                    });
Chris
Top achievements
Rank 1
 answered on 10 Oct 2012
0 answers
94 views
I know this functionality does not exist out of the box, but I was wondering if there was some way to have (force/hack/trick) the combo box to filter on two fields and use startswith.

If I was considering the contains filter there is an easy work around in that I could concatenate the two fields into one and point the filter at the new field. Sadly I'm required to only use starts with.

I was wondering if there was some private event that I can piggy back onto. For example, right after a combo box has filtered after a key press. Is there some event I can hook into?
C
Top achievements
Rank 1
 asked on 10 Oct 2012
2 answers
332 views
2 questions on this column:
{
                field: "RowTotal",
                title: "Row Total",
                aggregate: ["sum"],
                footerTemplate: "Total: #=sum#",
                format: "{0:c}",
            },



1. Why does column format: "{0:c}", show me Dollars when my regional settings set this to be in Euro?

2. Why does #=sum# (or in fact any aggregate) stop the footer from rendering ?

I get the javascript error that "sum" is not defined.
Greg
Top achievements
Rank 1
 answered on 10 Oct 2012
0 answers
154 views
Hi,

i got the issue that when navigating to an external view a jscript error is thrown complaining that data for a binding could not be found.
-- Uncaught Error: Unable to parse bindings. Message: ReferenceError: Username is not defined; Bindings value: value: Username  
--

This happens when the user tries to navigate to an external page like "/Studies/List/".

Actually I use kendo.bind to display the data on the view (but it's the same problem with knockout).

Basically my Views look like this:

--
<div data-role="layout" data-id="buttons" >
        <header data-role="header">
            <div data-role="navbar">                
                <span data-role="view-title"></span>
             </div>
        </header>        
        <!--View content will render here-->                  
    <footer data-role="footer">
        <div data-role="tabstrip">
        <a href="#home" data-icon="home">Home</a>
            <a href="#details" data-icon="home">Locale View</a>
            <a href="@( Url.Content("~/Studies/List") )" data-icon="mostrecent">External</a>
        </div>
    </footer>
    </div>

<div data-role="view" data-title="Home" data-layout="buttons" id="home">
    <div id="dataView">
    <span data-bind="text: name"></span>, <span data-bind="text: vorname"></span>
    </div>
</div>

<div data-role="view" data-title="Details" data-layout="buttons" id="details">
    <span data-bind="text: name"></span>
</div>
--

and here is the minimal JScript for it:

<script type="text/javascript">
var app = new kendo.mobile.Application(document.body, {
    transition: 'slide'
});


var data = kendo.observable({
    name: "LastName",
    vorname: "FirstName"
});

kendo.bind($("#dataView"), data);
kendo.bind($("#details"), data);
</script>

--


so, whenever the user is in the home screen (v1) hits the 3rd tab-button and the "external" view (v2) is loaded, v2 is never displayed because jscript complains about the missing data that is bound in v1.

Really strange. Did I mention that it doesn't matter if you use kendo.bind or the knockout-version? It doesn't, so i guess it's a problem from either the views or the application (or all two both :) )
Does anyone have a guess on how to solve this?

Up to now i tried to remove the bindings when navigating away with data-hide  ( ko.cleanNode() ) but that does not help.
Setting the attr "data-bind" to "" could work but that's indiscutable.

Any help would be really great.
RedTears75
Top achievements
Rank 1
 asked on 10 Oct 2012
1 answer
86 views

I have a simple class that has a class as one of it's properties.  I am trying to use the grid to both display the properties and allow in-line editing.  If I don't use default values and I try to edit I get "Microsoft JScript runtime error: Syntax error, unrecognized expression: [data-container-for=Person.PersonId].

If I do use default values I get "Cannot serialize objects of type Person" when I load the page.

Help would be greatly appreciated since I haven't been able to find any information.

-Kerry

Here's the code

class User
{
    int UserId;
    string LoginName;
    Person person;
}

class Person
{
    int PersonId;
    string FirstName;
    string LastName;
    string Email;
}

 

<%

 

= Html.Kendo().Grid<UserDto>()

 

.Name("UserListGrid")

.DataSource(ds => ds.Ajax()

.Update(update => update.Action("AjaxSaveUser", "User"))

.Destroy(destroy => destroy.Action("AjaxDeleteUser", "User"))

.Create(create => create.Action("AjaxInsertUser", "User"))

.Read(read => read.Action("List", "User"))

.Model(model => model.Id(m => m.UserId))

.Model(model => model.Field(m => m.UserId).Editable(false))

.Events(e => e.Error("grid_OnError"))

)

.Columns(col =>

{

col.Bound(us => us.UserId).Title("ID");

col.Command(us => us.Edit());

col.Bound(us => us.LoginName).Title("Login");

col.Bound(us => us.Person.PersonId).Hidden();

col.Bound(us => us.Person.LastName).Title("Last Name");

col.Bound(us => us.Person.FirstName).Title("First Name");

col.Bound(us => us.Person.Email).Title("Email");

col.Command(us => us.Destroy());

})

.ToolBar(commands => commands.Create().Text("Add User"))

.Editable(edit => edit.Mode(GridEditMode.InLine))

%>

Alexander Valchev
Telerik team
 answered on 10 Oct 2012
0 answers
355 views

Hello,

I'm trying to tweak my combo box for optimum performance but what I'm trying to do is either not possible or I do not know how to do it properly.

What I want to happen is this :

1. When my page loads I want it to load only the selected item. I'm setting my dataSource to autoBind false and creating an input with a single option which is the selectedValue that I return back from the server. Then on the open I'm selecting that initial selected value out of the returned results. The idea behind this is I want to display selectedValue but do not want load rest of results unless user accesses the dropdown.

2. When typing in the comboBox I want each request to be sent back to the server.  Currently it seems the way I have it setup that initially grabs the data from the server but then it does not callback to server as I change my typed value but instead limits value based on values already returned. The purpose behind this is my comboBox may return hundreds, if not thousands of records and I do not want it loading the whole set.

$('body').ready(function () {
 
 
                var jqWidget = $("#myWidget");
                var selectedValue = 1;
 
                var remoteDataSource = { transport:
                {
                    read:
                    {
                        dataType : "jsonp",
                        url : "http://localhost:8080/detail/000/q",
                        data :
                        {
                            retrieveValues : "true",
                            widgetName : "manufacturingLocation"
                        },
                        autoBind : false,
                        autoSync : true
                    },
                    serverFiltering: true
 
                }
                };
 
                var selectDropdownFunction = function( e )
                {
                    selectInitialValue( jqWidget, selectedValue );
                };
 
                jqWidget.kendoComboBox( {
                                                      dataSource : remoteDataSource,
                                                      autoBind : false,
                                                      dataTextField: "value",
                                                      dataValueField: "id",
                                                      open: selectDropdownFunction,
                                                      filter: "contains",
                                                      suggest: true,
                                                      index: 0,
                                                      delay: 800
 
                                                  } );
 
 
            });
 
            function selectInitialValue( jqWidget, selectedValue )
            {
                jqWidget.data('kendoComboBox').value(selectedValue);
            }


Any ideas how to do this? Or am I doing something wrong?

Eric
Top achievements
Rank 1
 asked on 10 Oct 2012
7 answers
837 views
Hi,

When I use modal: true in a kendoWindow's configuration, an overlay is displayed. If I'm seeing it correctly, the opacity of that overlay is animated when it is displayed, regardless of whether the overall effects for the window itself have been set.

This is fine, but the direction of the animation could be better, imo. It happens quite quickly, so it's hard to see, but I think the following happens:

1. The opacity attribute for .k-overlay is defined as 0.5 by default (in kendo.common.min.css).
2. When the overlay is displayed, the opacity is briefly set to 1.0, and thus the overlay looks solid black.
3. The opacity is then changed or even animated to the intended value of 0.5.

We are perceiving the temporary opacity of 1.0 as a flickering effect, which doesn't look very nice. It would be better if the opacity animation started at 0.0 and is then changed back to 0.5. Is it possible to achieve this or even fix this permanently? Thanks.
Kamen Bundev
Telerik team
 answered on 10 Oct 2012
1 answer
350 views
Hi,

I have Kendo Window in my web pages but, the issue, I'm having, is that the window open and close animation is not smooth in Chrome, whereas it's all good in IE, FireFox and Safari. The window opens and closes slowly and with distorted animation in Chrome. Is there a way I can fix this issue? Is there something different about Chrome that I need to consider while developing my web application?

Regards,

Umais
Vladimir Iliev
Telerik team
 answered on 10 Oct 2012
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
Date/Time Pickers
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)
SPA
Filter
Drawing API
Drawer (Mobile)
Globalization
Gauges
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
OrgChart
TextBox
Effects
Accessibility
ScrollView
PivotGridV2
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
Popover
DockManager
FloatingActionButton
TaskBoard
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
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?