Telerik Forums
Kendo UI for jQuery Forum
0 answers
172 views
Hi. I am having a little problem with kendo window, hope you guys can help me out.

I am developing an ASP.NET Web Forms application where i use some kendo controls with asp.net server controls. 
In this application I have a page where the user clicks in a button which will open a kendo window. This kendo window has an asp:TextBox (which will turn into a kendo datetimepicker) and a Save button. 

The problem is: when this textbox is inside the kendo window, it arrives on server side code without value.
When i comment the kendo window initialization code, everything works out just fine. 

Does the kendo window create another form or something?

My codes:

Window and textbox:
<div id="newSessionWindow">
 
<label for="sessionDate">Data da próxima sessão*</label><br />
<asp:TextBox runat="server" ID="sessionDate" ClientIDMode="Static"></asp:TextBox>
             
<br /><br />   
             
<asp:LinkButton runat="server" ID="SaveSession" Text="Salvar" CssClass="k-button" />
 
</div>


Initializing kendo window and kendo datetimepicker
// New Session Window
                 $("#newSessionWindow").kendoWindow({
                     draggable: true,
                     appendTo: "#globalBody",
                     height: "110px",
                     modal: true,
                     resizable: false,
                     title: "Nova sessão",
                     width: "400px"
                 });
 
                 $("#sessionDate").kendoDateTimePicker({
                     format: "dd/MM/yyyy hh:mm tt",
                     start: "month",
                     depth: "month",
                     min: new Date(year, month, day)
                 });

Handling the click event of the button who opens the kendo window:
$("#AddSession").click(function (e) {
 $("#newSessionWindow").show();
                      
 var newSession = $("#newSessionWindow").data("kendoWindow");
 newSession.center();
 newSession.open();
});

Best Regards!
Eric
Top achievements
Rank 1
 asked on 26 Sep 2012
0 answers
85 views
Hi,

I am using the Kendo Web UI controls to build a responsive web application using HTML5, CSS3, javascript, etc.  I would like to use the kendo mobile tabstrip in my application.  Will this play nice with the web ui layout I already have in place?  In the tabstrip example I see that I need a div with the data-role="view" attribute/value in addition to the following line of javascript code:

window.kendoMobileApplication = new kendo.mobile.Application(document.body);

Can an existing web ui application "become" a mobile application too?

Thank you,

Dan
Daniel
Top achievements
Rank 1
 asked on 25 Sep 2012
4 answers
335 views
I'm having trouble loading the collection which defines the insertHtml text/value pairs using a datasource.

What I'd like to do is have the user choose a template to edit, and have the insertHtml load accordingly. Therefore I have global datasources for the templates and the insertHtml data, and the change event on the template selector triggers a read on the insertHtml datasource:

<script type="text/javascript">
 
        var templateSource = new kendo.data.DataSource({
            schema: {
                data: "d",
                model: {
                    id: "title",
                    fields: {
                        title: { type: "string" },
                        value: { type: "string" },
                        type: { type: "number" }
                    }
                }
            },
            transport: {
                read: {
                    contentType: "application/json; charset=utf-8",
                    type: "POST",
                    url: "http://localhost:23035/foo/bar"
                },
                parameterMap: function (data, operation) {
                    if (operation == "read") {
                        return JSON.stringify({ user_id: arg('foo') })
                    }
                }
            }
        })
 
        var tokenSource = new kendo.data.DataSource({
            schema: {
                data: "d"
            },
            transport: {
                read: {
                    contentType: "application/json; charset=utf-8",
                    type: "POST",
                    url: "http://localhost:23035/foo/rab"
                },
                parameterMap: function (data, operation) {
                    var type = $('#templateSelector').data("kendoDropDownList").dataItem().type;
                    return JSON.stringify({ email_template_type_id: type })
                }
            }
        })
 
        $(document).ready(function () {
 
            $("#templateSelector").kendoDropDownList({
                dataTextField: "title",
                dataValueField: "value",
                dataSource: templateSource,
                change: function () {
                    var value = $("#templateSelector").val();
                    var editor = $("#editor").data("kendoEditor");
                    editor.value(value);
                    tokenSource.read();
                }
            });
 
            $("#editor").kendoEditor({
                tools: [
                    "insertHtml"
                ],
                insertHtml: tokenSource.data()
            });
        })
 
    </script>

For some reason this won't work. I'm getting an error in kendo.all.min.js:8 "Uncaught TypeError: Cannot call method 'removeClass' of undefined " when it tries to read into the insertHtml datasource.
David
Top achievements
Rank 1
 answered on 25 Sep 2012
0 answers
58 views
Hi all

I have working the Kendo grid with jquery 1.7.2, but I upgraded it to 1.8.1 and grouping and selection features stopped working.

I would know if next version of Kendo will be compatible with these version of jquery and when will be available for download?

Thanks

Esteban.-
Esteban
Top achievements
Rank 1
 asked on 25 Sep 2012
0 answers
111 views
There is very little documentation for building custom widgets with data binding to an observable view model:

Please review the code at
http://jsfiddle.net/JWT6g/
and answer my questions at
retrieving-the-view-model-observableobject-within-a-custom-widget.aspx
Jack
Top achievements
Rank 2
Iron
 asked on 25 Sep 2012
0 answers
380 views
I seem to be having an issue where the numerictextbox widget does not pull the custom class assigned to the original input field. 

The combobox and other widgets seem to do as expected, and add the original class to span.k-widget, however it doesn't seem to be happening ok span.k-widget.k-numerictextbox

Any ideas? Is this a bug, or is this expected behavior? If it is expected, how does one go about adding a custom class (or id) to span.k-widget.k-numerictextbox?

Thanks in advance for your help.

Here's a js fiddle to show you what's happening: http://jsfiddle.net/MCCPs/4/
Jeremy
Top achievements
Rank 1
 asked on 25 Sep 2012
1 answer
255 views
I have implemented the KenoUI javascript Grid within an application. I have the filtering all working correctly, except it seems the KendoUI Grid doesn't support the ability to filter blank/emtpy field values.

Basically, in the filter dropdowns, I need there to be a "Blank" option that allows for only items where that field is either null or an empty string. How do you add this option to the dropdown?
Chris Pietschmann
Top achievements
Rank 1
 answered on 25 Sep 2012
1 answer
115 views
I am fairly new to MVC
I have tried all day to use the MVVM Remote Binding example to update the model using form post instead of json to post to a controller action and it won't map the post data to the IEnumerable<ProductViewModel> products argument of my controller action. I have inspected the post parameters and this is what I see:

models[0][Discontinued] false
models[0][ProductID] 3
models[0][ProductName] Aniseed Syrup
models[0][UnitPrice] 12
models[0][UnitsInStock] 13
models[0][UnitsOnOrder] 0

In the working example for Kendo Grid Editing Custom, I noticed that the post parameters should be more like this:

models[0].Discontinued false
models[0].ProductID 3
models[0].ProductName
Aniseed Syrup
models[0].UnitPrice 12
models[0].UnitsInStock 13
models[0].UnitsOnOrder 0

Notice how the properties are not indexed. I am guessing that this is why it doesn't work.

Does anyone have a working example (with controller source) of Kendo MVVM being used to update the model?
Nathan
Top achievements
Rank 1
 answered on 25 Sep 2012
3 answers
310 views
Hello,

First off, thanks for putting together a great suite of controls. You've made my life as a mobile environment developer much easier! I do have a question though. I see in the release notes and in the documentation that the mobile View supports an event called "beforeShow".  Is there an example somewhere that utilizes that event? I'm trying to wire up some logic around the browser's back button and I'd like to use that event to determine if the user is logged in before displaying the requested view. When I try to attach a handler to the event like so:

<div data-role="view" id="someView" data-show="showSomeView" data-beforeShow="viewBeforeShow">
/* div content here */
</div>


The viewBeforeShow method never fires.  The showSomeView event works as expected, but the user is able to navigate back to that view even though they are no longer logged in to the app (exactly the case I'm trying to prevent). 

Here is the code for viewBeforeShow:

function viewBeforeShow(view) {
    if(loggedOut == true) {    // loggedOut is just a global variable for now
        window.kendoMobileApplication.navigate('#loginView');  // loginView is the login mobile view
    }
}

I don't know if this is the correct way to handle this scenario, but I can figure that out once I start handing the event.

I should mention I'm using the trial version 2012.2.710 (just downloaded it today). I will eventually translate this to the licensed version for my employer, but I was trying a proof of concept before I worried about that.

Is this the right way to configure the handler for this event? Any help would be greatly appreciated.

Thanks again for the great work!
Puño de la estrella del Norte
Top achievements
Rank 1
 answered on 25 Sep 2012
1 answer
761 views
I have a models
Route:
int RouteID;
String RouteName;
IEnumerable<RouteCustomer> Customers;

RouteCustomer:
int RouteID;
int CustomerID;
int Sun;
int Mon;
int Tue;
int Wed;
int Thue;
int Fri;
int Sat;

Customer:
int CustomerID;
String Name;

I have created an edit form that allows changes (route name) and a grid for the customer information.  What is happening now is that I am not getting the events I need when adding a new row to the grid:

Here is the grid code:
@(Html.Kendo().Grid<LightRouteDB.RouteCustomer>()
            .Name("CustomerGrid")
            .Columns(cols =>
                {
                    cols.Bound(r => r.CustomerID);
                    //cols.Bound(r => r.Customer.CustomerName);
                    cols.Bound(r => r.Sun);
                    cols.Bound(r => r.Mon);
                    cols.Bound(r => r.Tue);
                    cols.Bound(r => r.Wed);
                    cols.Bound(r => r.Thu);
                    cols.Bound(r => r.Fri);
                    cols.Bound(r => r.Sat);
                    cols.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
                })
                .ToolBar(toolbar => toolbar.Create())
                .Editable(editable => editable.Mode(GridEditMode.InLine))
                .Pageable()
                .Sortable()
                .Scrollable()
                .DataSource(ds => ds
                    .Ajax()
                    .Events(events => events.Error("error_handler"))
                        .Model(m => { m.Id(p => p.RouteCustomerID); m.Field(f => f.RouteID).DefaultValue(Model.Route.RouteID); })
                    .Create(a => a.Action("CreateCustomerRow", "Routes"))
                    .Read(r => r.Action("ReadCustomerRows", "Routes"))
                    .Update(u => u.Action("UpdateCustomerRow", "Routes"))
                    .Destroy(d => d.Action("DestroyCustomerRow", "Routes"))
                )
          )
And here is the controller:
public ActionResult ReadCustomerRows(int id, [DataSourceRequest] DataSourceRequest request)
       {
           return Json(getRouteCustomersFromSession().ToDataSourceResult(request));
       }
 
       [AcceptVerbs(HttpVerbs.Post)]
       public ActionResult CreateCustomerRow(int id, [DataSourceRequest] DataSourceRequest request,  RouteCustomer customer)
       {
           if (customer != null && ModelState.IsValid)
           {
               IList<RouteCustomer> rc = getRouteCustomersFromSession();
               rc.Add(customer);
           }
 
           return Json(new[] { customer }.ToDataSourceResult(request, ModelState));
       }
 
       [AcceptVerbs(HttpVerbs.Post)]
       public ActionResult UpdateCustomerRow([DataSourceRequest] DataSourceRequest request, RouteCustomer customer)
       {
           if (customer != null && ModelState.IsValid)
           {
               IList<RouteCustomer> rc = getRouteCustomersFromSession();
               var target = rc.Where(c => c.RouteCustomerID == customer.CustomerID).First();
               if (target != null)
               {
                   target.CustomerID = customer.CustomerID;
                   saveRouteCustomersToSession(rc);
               }
           }
 
           return Json(ModelState.ToDataSourceResult());
       }

The events in the controller just don't seem to fire.  I thought I copied it from the sample programs, but it doesn't seem to work correctly.  Any help would be appreciated.
John
Top achievements
Rank 1
 answered on 25 Sep 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?