Telerik Forums
Kendo UI for jQuery Forum
1 answer
245 views
I can't make the scheduler to read the data I created SchedulerTaskService here I put some of the code:

public class SchedulerTaskService : ISchedulerEventService<TaskViewModel>
{

public SchedulerTaskService()
{

}

public virtual IQueryable<TaskViewModel> GetAll()
{

List<TaskViewModel> lista = new List<TaskViewModel>();

TaskViewModel node = new TaskViewModel();

node.TaskID = 1;
node.Description = "Hello";
node.Ficha_Num = "126293860";
node.Medico = "JGO1230";
node.Title = "JOHNNY GONZALEZ SOTO";
node.Start = new DateTime(2013,10,13,9,0,0);
node.End = new DateTime(2013, 10, 13, 9, 15, 0);
node.Telefono = "2719944";
node.StartTimezone = "Etc/UTC";
node.EndTimezone = "Etc/UTC";
node.OwnerID = 1;

lista.Add(node);

return lista.AsQueryable();
}
____________________________________________________________________

public partial class SchedulerController : Controller
{
private SchedulerTaskService taskService;


public SchedulerController()
{
this.taskService = new SchedulerTaskService();
}

public ActionResult Index()
{
return View();
}

public virtual JsonResult Read([DataSourceRequest] DataSourceRequest request)
{
return Json(taskService.GetAll().ToDataSourceResult(request));
}
______________________________________________________________________________________

@(Html.Kendo().Scheduler<TaskViewModel>()
.Name("scheduler")
.Date(DateTime.Today)
.StartTime(new DateTime(2013, 1, 1, 7, 00, 00))
.EndTime(new DateTime(2013, 1, 1, 18, 00, 00))
.Height(500)
.MinorTickCount(1)
.MajorTick(15)
.Selectable(true)
 

.Editable(e => e.TemplateId("editor"))

.Views(views =>
{
views.DayView();
views.WeekView(weekView => weekView.Selected(true));
views.MonthView();
views.AgendaView();

 })

.Messages(message =>
{
message.Today("Hoy Día");
message.AllDay("Todo el Día");
message.Save("Reservar");
message.Cancel("Cerrar");
message.Views(views =>
{
views.Day("Diario");
views.Month("Mensual");
views.Week("Semanal");


});

message.ShowWorkDay("Mostrar Todo el Día");
message.ShowFullDay("Mostrar Horario");


message.Editor(Editor =>
{
Editor.EditorTitle("Cita");

});


})

.Timezone("Etc/UTC")

.DataSource(d => d
.Model(m =>
{
m.Id(f => f.TaskID);
//m.Field(f => f.OwnerID).DefaultValue(1);
})


.Read("Read", "Scheduler")
.Create("Create", "Scheduler")
.Destroy("Destroy", "Scheduler")
.Update("Update", "Scheduler")
//.Filter(filters =>
//{
// filters.Add(model => model.OwnerID).IsEqualTo(1).Or().IsEqualTo(2);
//})
)

)
____________________________________________________________________

<script id="editor" type="text/x-kendo-template">

<table border="0">
<tr style="border-style:hidden">
<td style="border-style:hidden"><label>Paciente</label></td>
<td style="border-style:hidden"><input style="width:300px;" data-bind="value: Title" /> <button class="k-button" data-bind="value: buscar_ficha">Buscar</button></td>
</tr>
<tr style="border-style:hidden">
<td style="border-style:hidden">Teléfono</td>
<td style="border-style:hidden"><input data-bind="value: Telefono"/></td>
</tr>
<tr style="border-style:hidden">
<td style="border-style:hidden">Comienza</td>
<td style="border-style:hidden"><input data-role="datetimepicker" data-bind="value: start" /></td>

</tr>
<tr style="border-style:hidden">
<td style="border-style:hidden">Finaliza</td>
<td style="border-style:hidden"><input data-role="datetimepicker" data-bind="value: end" /></td>
</tr>
<tr style="border-style:hidden">
<td style="border-style:hidden">Médico</td>
<td style="border-style:hidden"><input data-bind="value: Medico"/></td>
</tr>
<tr style="border-style:hidden">
<td style="border-style:hidden">Ficha</td>
<td style="border-style:hidden"><input data-bind="value: Ficha_Num"/></td>
</tr>
<tr style="border-style:hidden">
<td style="border-style:hidden">Memo</td>
<td style="border-style:hidden"><input style="width:300px;" data-bind="value: Description"/></td>
</tr>
</table>

</script>


any help would be appreciated

Johnny
Rosen
Telerik team
 answered on 14 Oct 2013
3 answers
136 views
Hi,
I'm testing both devexpress and telerik MVC components to decide which one is more suitable for my company needs.
we need to implement a filter on a column with multiple selection. I couldnt find a way to achive that in kendo ui like http://demos.devexpress.com/MVC/GridView/Filtering.
Filter section should be at the header and each column can have its own multi selection filter.

is there anyway to do that in kendo ui?

thanks

Alexander Valchev
Telerik team
 answered on 14 Oct 2013
3 answers
184 views
Hi,

I  am working with a login page, in that form i am having two fields(username, password). When i submit the page, it will validate the form and post the data to a url and api returns a message if the credential are correct. Now i want to get the success value to check whether its success/error. If success i am navigate to dashboard page. Please find my index.html, loginViewModel.js files. Kindly approach me how to get the response value from server and navigate to other page one its success.

index.html

<!DOCTYPE html><br><html><br><head><br><meta charset="ISO-8859-1"><br><title>Login</title><br>  <link href="styles/kendo.mobile.all.min.css" rel="stylesheet" /><br></head><br><body><br> <div data-role="view" data-title="Settings" id="loginForm"><br>       <header data-role="header"><br>           <div data-role="navbar"><br>              <span data-role="view-title"></span><br>          </div><br>        </header><br>       Server: <input id="serverid" name="authserver" type="url" data-bind="value: authserver" required data-required-msg="Enter server address" data-url-msg="Enter a valid url for server"><br>        <span class="k-invalid-msg" data-for="authserver"></span><br/><br>        UserName: <input id="emailid" name="username" type="email" data-bind="value: username" required data-required-msg="You need to enter email" data-email-msg="Enter a valid email id"><br>      <span class="k-invalid-msg" data-for="username"></span><br/><br>      Password: <input id="pwd" name="password" type="password" data-bind="value: password" required validationMessage="Enter Password with minimum 6 characters"><br>      <span class="k-invalid-msg" data-for="password"></span><br/><br>      <button data-bind="click: getUserDetails">Login</button><br>    </div><br>    <script src="scripts/jquery.min.js"></script><br>    <script src="scripts/kendo.all.min.js"></script><br>    <script src="scripts/viewModel/loginModel.js"></script><br>    <script src="scripts/viewModel/loginViewModel.js"></script><br>    <script><br>     /** Initial the kendo mobile application */<br>       var app = new kendo.mobile.Application(document.body);<br>    </script><br></body><br></html>


Below is the viewModel file loginViewModel.js


var validator = $("#loginForm").kendoValidator().data("kendoValidator");<br><br>var loginViewModel = kendo.observable({<br> authserver: "",<br> username:"",<br>    password:"",<br>    getUserDetails: function(){<br>     if(validator.validate()){<br>       //  alert("Server Address -- "+ this.get("authserver")+" User Name -- "+ this.get("username")+" User Password -- "+ this.get("password"));<br>          <br>                var dataSource = new kendo.data.DataSource({<br>                    transport:{<br>                     read:{<br>                          url: "http://127.0.0.1/api/index.php",<br>                          type: "POST",<br>                           dataType: "html",<br>                           <br>                        }<br>                   },<br>                  change: function(data){<br>                     alert("aaa"+dataSource.data);<br>                       alert(data);<br>                    },<br>                  error: function(xhr, error){<br>                        console.log(xhr);<br>                       console.log(error);<br>                 }<br>               });<br>     }else{<br>          alert("Not valid");<br>     }<br>       <br>    },<br>  <br>}) ;



kendo.bind($("#loginForm"), loginViewModel);
Kiril Nikolov
Telerik team
 answered on 14 Oct 2013
1 answer
277 views
Hi! i creating a nested list view as much as possible it must be accordion like this:
 http://jquerymobile.com/wp-content/uploads/2012/07/jquery-mobile-collapsible-lists.png

But i cant find any examples near to that so i aim to do this
http://demos.telerik.com/teampulse-demo/view#IterationsStatus 

with this code:

<!--- Layout --->
    <section data-role="layout" data-id="default">
        <!--View content will render here-->
        <header data-role="footer">
            <div data-role="navbar">
                <span data-role="view-title">Home</span>
                <a data-align="right" data-icon="icon-three-dot" data-role="button" href=""></a>
                <a data-align="left" data-icon="icon-three-bar" data-role="button"  href="#sideMenuView" data-rel="drawer"></a>
            </div>
        </header>
    </section>
<!--- End Layout --->
 
<!--- Drawers --->
    <div data-role="drawer" id="sideMenuView" data-show="rebindListView" data-transition="slide">
        <div data-role="footer">
           <div id="sideMenuNavbar" data-role="navbar" class="bg-white">
                <span data-role="view-title" >
                    <img src="./styles/images/SlideNav.png">
                </span>
                <a data-role="backbutton" id="btnDrawerBack" data-align="left">Back</a>
           </div>
        </div>
        <div class="container">
            <ul id="sideMenuListView"
                class="sideMenuListView"
                data-role="listview"
                data-template="sideMenuDrawer-template"
                data-style="inset">
            </ul>
        </div>
    </div>
<!--- End Drawers --->
 
<!-- Script Templates -->
         <script id="sideMenuDrawer-template" type="text/x-kendo-template">
        <div class="#: style #">
            # if (data.style == 'settings') { #
                <a data-align="left" data-icon="icon-gears" data-role="button" class="btn-icon" data-click="rebindListView"></a>
            # } else { #
                <a data-align="left" data-icon="icon-angle-right" data-role="button" class="btn-icon" data-click="rebindListView"></a>
            # } #
            <div data-role="button" class="text btn-text" data-click="#: view #">#: name #</div>
        </div>
         </script>
<!-- End Script Templates -->
 
<!-- Script Variables -->
    <script>
        var category = new kendo.data.DataSource({
            data: [
                {id: 1, name: "Dogs", view:"dogView", style:""},
                {id: 2, name: "Cats", view:"catModalView", style:""},
                {id: 3, name: "Birds", view:"birdView", style:""},
                {id: 4, name: "Snakes", view:"snakeView", style:""},
                {id: 5, name: "Cows", view:"cowView", style:""}
            ]
        }),
        type = new kendo.data.DataSource({
            data: [
                {id: 1, category: 2, name: "Persian"},
                {id: 2, category: 2, name: "Arabian"},
                {id: 3, category: 2, name: "Local"},
                {id: 4, category: 1, name: "Husky"},
                {id: 5, category: 1, name: "Retriever"}
            ]
        })
    </script>
<!-- End Script Variables -->
 
<!-- Script Functions -->
    <script>
        function rebindListView(e) {
            var params  = e.view.params,
                element     = e.view.element,
                backButton  = element.find('#btnDrawerBack'),
                listView    = element.find("#sideMenuListView").data('kendoMobileListView');
                 
            if (params) {
                var parentID = e.view.params.parent;
                    sideItem    = type.filter({field: "category", operator: "eq", value: parentID});
                     
                    if (sideItem) {
                        backButton.show();
                        listView.setDataSource(sideItem);
                    } else {
                        // redirect to root
                        setTimeout(function() {
                            kendo.mobile.application.navigate('#homeView');
                        }, 0);
                    }
                     
            } else {
                backButton.hide();
                listView.setDataSource(category);
            }
     
            e.view.scroller.scrollTo(0, 0);
             
        }
 </script>
<!-- End Script Functions -->

When i click the button for more options (the one that call rebindListView)
i always got this error: Uncaught TypeError: Cannot read property 'params' of undefined index.html:206
Kiril Nikolov
Telerik team
 answered on 14 Oct 2013
3 answers
346 views
Hi There,

I'm trying to get a dropdown list used with Kendo UI mobile and data bind the source of the dropdown list to some set data.

It seems to work when a plain select is used but when i change the data-role to dropdown list the list is always empty. 

I have include a sample of the problem i am experiencing.

http://jsbin.com/ADOTuG/1/

Is there something I am doing wrong here or should do differently?

Thanks,

Rob
Petyo
Telerik team
 answered on 14 Oct 2013
1 answer
217 views
I'm building a table with large number of columns which I want to be able to show and hide from user menu.
As the example I can use this

http://demos.kendoui.com/web/grid/column-menu.html

My problem is that show/hide menu is the same for all columns, but it is buried deep inside column menu of each individual column.
I want to have that menu only in one place, possibly in table toolbar or exposed in footer so the user does not need to click through the complex dropdowns.



Nikolay Rusev
Telerik team
 answered on 14 Oct 2013
1 answer
60 views
Hello team

After replacing the .css and the .js files with the latest KendoUI Mobile - and installing on my iOS7 device, the tabstrip icons, and data-icons for various menus within my application have mucked up. Instead of the data-icon "home" , the data-icon "search" pictures, I get random pictures, like a love heart, a spade, a number 3 in a box, an angel.. etc... is there something I have missed?  Do I have to explicitly define images now?

Thankyou.

Regards
Kamen Bundev
Telerik team
 answered on 14 Oct 2013
8 answers
699 views
We're using this control for tags and we want to let them select an existing tag or add a new tag.

What's the recommended approach for adding an option to the list such as "Add New" that uses the currently entered text to create a new item?

  Nick
Joshua
Top achievements
Rank 2
Iron
Veteran
Iron
 answered on 13 Oct 2013
5 answers
1.6K+ views
I have custom buttons inside my Kendo Grid, but would like the buttons to show an image and not text, how can I do this?  I have searched the forum but can't find a solution.

Thanks!
Kris Nobels
Top achievements
Rank 2
 answered on 12 Oct 2013
2 answers
488 views
Hi,

I have a TreeView for a filter on a dashboard, and it's not processing the click on the checkbox the second time.  I've attached a screen shot with more details.

I'm not sure what I have wrong.
Creating the TreeView:
/* Topics illustrated in this file:
* How to define a custom widget
* How to configure options from base
* How to define and access custom options
* How to capture scope
* How to manipulate the DOM of "this"
* How to expose custom methods
* How to expose an event handler delegate
*/
define([
       'jquery',
       'underscore',
       'utils/helpers',
       'text!views/schoolFilterItem.html',
       'kendoui/kendo.treeview.min',
], function ($, _, Helpers, schoolFilterItemTemplate) {
    var schoolData;
 
    // This defines a Kendo widget object
    var TreeView = kendo.ui.TreeView.extend({
        init: function (element, options) {
            // Assigning this to another variable name captures the context of init, which is "this TreeView"
            var me = this;
            options.dataSource = {
                transport: {
                    read: function (options) {
                        $.getJSON(Helpers.toServicesUrl("/GetfltSchoolByDistrict"),
                                         {
                                             // If you tried to use "this" in here, it would refer to the dataSource instead of the TreeView
                                             userName: me.options.userName,
                                             districtId: me.options.districtId,
                                             schoolCodes: me.options.schoolCodes
                                         },
                                         function (data) {
                                             options.success([]);
                                             schoolData = data.GetfltSchoolByDistrictResult.RootResults;
                                             schoolData = [
                                                       {
                                                           text: "Schools",
                                                           expanded: false,
                                                           items: _(schoolData)
                                                                     .chain()
                                                                     .groupBy("SchoolTypeName")
                                                                     .map(function (groupItems, groupKey) {
                                                                         return {
                                                                             SchoolTypeName: groupKey,
                                                                             items: groupItems,
                                                                             expanded: false
                                                                         }
                                                                     })
                                                                     .value()
                                                       }
                                                ];
                                             me.dataSource.data(schoolData);
 
                                         });
                    }
                },
                schema: {
                    model: {
                        children: "items"
                    }
                }
            };
            options.dataBound = function (e) {
                me.element.find("input:checkbox:first").prop("disabled", true);
                me.element.find("input:checkbox").on("change", function (e) {
 
                    var parentItems = $(e.target).parents(".k-item");
                    var node = parentItems.eq(0);
                    var parentNode = parentItems.eq(1);
                    // Toggle children to match parent
                    node.find("input:checkbox").prop("checked", e.target.checked);
                    // Update parent's state
                    var parentCheckBox = parentNode.find("input:checkbox:first");
                    if (!parentCheckBox.prop("disabled")) {
                        var hasChecked = parentNode.find(".k-group input:checked").length > 0;
                        var hasUnchecked = parentNode.find(".k-group input:not(:checked)").length > 0;
                        parentCheckBox.prop("checked", hasChecked);
                        parentCheckBox.prop("indeterminate", hasChecked && hasUnchecked);
                    }
                    // The rest is unchecking other SchoolTypes if a different SchoolType is checked. If "this" is unchecked, no further action required.
                    if (!e.target.checked)
                        return;
                    var dataItem = me.dataItem(node);
                    if (!dataItem.SchoolTypeName) {
                        e.target.checked = false;
                        return;
                    }
                    me.element.find("input:checked").each(function () {
                        var eachDataItem = me.dataItem($(this).closest(".k-item"))
                        if (eachDataItem.SchoolTypeName !== dataItem.SchoolTypeName) {
                            this.checked = false;
                            this.indeterminate = false;
                            //lah testing adding something here.
                            //                            me.schoolTypeChanged(e);
                            me.onSchoolChange(e);
                        }
                        //gmo when school names don't match
                        if (eachDataItem.SchoolName !== dataItem.SchoolName) {
                            this.checked = false;                      
                            me.onSchoolChange(e);
                        }
 
                    });
 
                });
 
            }
            kendo.ui.TreeView.fn.init.call(this, element, options);
        },
        options: {
            // This is what determines the name of the custom method, e.g. .kendoSchoolFilterTreeView
            name: "TreeViewSchoolFilterSingle",
            // Declare new options with default values. Options must be declared here in order to be accepted and passed through to init().
            userName: "",
            districtId: 0,
            schoolCodes: function () { return "" },
            // Anything else you pass in options will get passed to the base widget
            dataTextField: ["text", "SchoolTypeName", "SchoolName"],
            checkboxes: true
        },
 
        getSelectedSchoolType: function () {
            var me = this;
            return _(this.element.find("input:checked").closest(".k-item"))
                .chain()
            //                                              .map(function (item) { return ktvSchoolFilter.dataItem(item).SchoolType; })
                .map(function (item) { return me.dataItem(item).SchoolType; })
                .filter(function (item) { return item; })
                .value()[0];
 
        },
        // This is how to get the selected school from the radio group
        getSelectedSchoolCodes: function () {
            var me = this;
            return _(this.element.find("input:checked").closest(".k-item"))
                                  .chain()
            //                                              .map(function (item) { return ktvSchoolFilter.dataItem(item).SchoolCode; })
                                  .map(function (item) { return me.dataItem(item).SchoolCode; })
                                  .filter(function (item) { return item; })
                                  .value()
                                  .join(",");
        },
        onSchoolChange: function (e) {
            return;
        },
 
        schoolTypeChanged: function (e) {
            return;
        }
    });
 
    // This is what registers the custom widget and adds the kendo* method to the jQuery object
    kendo.ui.plugin(TreeView);
});


How it's used in my program, including several variations on binding.
ktvSchoolFilter = $("#schoolFilterTree").kendoTreeViewSchoolFilterSingle({
            userName: WSIPCContext.UserName,
            districtId: WSIPCContext.DistrictId,
            schoolCodes: WSIPCContext.SchoolCodes,
            onSchoolChange: schoolCodeChanged,
            change: schoolCodeChanged,
            schoolTypeChanged: schoolCodeChanged,
            checkbox: {
                onClick: schoolCodeChanged
            }
 
        }).data("kendoTreeViewSchoolFilterSingle");
 
 
//This code allows the grade level and risk categories to change when a checkbox
        //is selected, not just the label.
        ktvSchoolFilter.dataSource.bind("change", schoolCodeChanged);
        ktvSchoolFilter.dataSource.bind("select", schoolCodeChanged);
        ktvSchoolFilter.dataSource.bind("selecting", schoolCodeChanged);
        ktvSchoolFilter.dataSource.bind("navigate", schoolCodeChanged);
 
        ktvSchoolFilter.bind("change", schoolCodeChanged);
        ktvSchoolFilter.bind("select", schoolCodeChanged);
        ktvSchoolFilter.bind("selecting", schoolCodeChanged);
        ktvSchoolFilter.bind("navigate", schoolCodeChanged




Lisa
Top achievements
Rank 1
 answered on 11 Oct 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
Dialog
Chat
DateRangePicker
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
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?