Telerik Forums
Kendo UI for jQuery Forum
1 answer
1.1K+ views
Hi, I am using Kendo Grid in my application with Server side sorting. I am sending additional data(object) to my method.

var viewModel = kendo.observable({
        param: {
            LeadName: "",
            LeadPriority: 1,
            Notes: "",
            Address: "",
            City: "",
            State: "",
            Zip: "",
            Booked:  1,           
            SearchText: ""
        }
});

$("#leadsGrdView").kendoGrid({
        dataSource: {
            type: "aspnetmvc-ajax",
            transport: {
                read: {
                    url: "Lead/GetLeadListResult",
                    data: JSON.parse(JSON.stringify(viewModel.param))
                }
            },
            schema: {
                model: {
                    fields: {
                        Name: { type: "string", editable: false },
                        Priority: { type: "string", editable: false },
                        Notes: { type: "string" },
                        Booked: { type: "checkbox", editable: false },
                        Address: { editable: false },
                        Id: { type: "int" }
                    }
                },
                total: "Total",
                data: "Data"
            },
            pageSize: 10,
            serverPaging: true,
            serverFiltering: true,
            serverSorting: true
        },
        scrollable: false,
        sortable: true,
        groupable: false,
        pageable: { buttonCount: 4 },
        columns: [{ template: '<a href="/Lead/LeadDetail/#=Id#">#=Name#</a>', field: "Name", title: "Lead Name", width: "30%" },
                  { field: "Priority", title: "Lead Priority", width: "20%" },
                  {
                      field: "Address",
                      title: "Address", width: "30%",
                      template: '<span> #=Address.Address1#, #=Address.City# #=Address.State# </span>'
                  },
                  { field: "Notes", title: "Notes", width: "30%" },
                  {
                      field: "Booked",
                      template: '<input type="checkbox" #= Booked ? "checked=checked" : "" # ></input>'
                  }
        ]
    });

I am using viewModel.param object in my view. I am sending viewModel.param object as an additional data to the method.I can able to retrieve additional data to my method. This works as expected till now. After viewModel.param object variables are modified and if I try to sort any column, the updating additional data is not being sent to method, instead it sends the initial data when Kendo grid is initially loaded. 
How can I send the updated additional data in Server side sorting? Is there any better approach than this to accomplish my requirement.
All I need is to send the updated object I have in my javascript to the method in the controller when using server side sorting. 
Any help will be greatly appreciated
Alexander Valchev
Telerik team
 answered on 15 Aug 2014
1 answer
212 views
hi, i have a simple MVVM listview that get data from a json webservice.:

<div data-role="view"  
     data-model="app.products.viewModel" >
    <ul 
                    data-role="listview" 
                    data-bind="source: productsDS"
                    data-template="product-template">
        
    </ul>                              
</div>

and my viewModel:
(function (global) {
    var ProductViewModel,
        app = global.app = global.app || {};

    ProductViewModel = kendo.data.ObservableObject.extend({   
        productDS: "",        
        init: function() {         
            var that = this,
                dataSource;         
            kendo.data.ObservableObject.fn.init.apply(that, []);
            // Get Session from localStorage when user login.
            var session = getSession();
           
            var dataSource = new kendo.data.DataSource({
            transport: {
                read: {
                    url: "http:/.... my service" +  session,
                    dataType: "json"
                }
            },
            schema: {
               data: "results.data"
            }
        });
            that.set("productDS", dataSource);
       }      
    });

    app.products = {
        viewModel: new ProductViewModel()
    };
})(window);



When i start the app, i get no data from the datasource because session is still "undefined". Session is a value the user get doing a previous login.
If i refresh the app (appBuilder Simulator), then the session is not nul and everything works.

how i can trigger the dataSource when i have the session already?





Alexander Valchev
Telerik team
 answered on 15 Aug 2014
1 answer
137 views
Hi, I want to show a div (with text "Insert div text here" in the example file attached) when you edit the age of a row, but if you click on that div, the input should not lose the focus.
It works properly on firefox, chrome and latest versions of IE, but on IE8 it doesn't work, when you click on the div, the cell loses the focus and de input cell closes.

You can execute example.html to better understanding of my problem.

Thanks.
Nikolay Rusev
Telerik team
 answered on 15 Aug 2014
1 answer
284 views
I have implemented drag and drop onto a scheduler widget using sample code from Telerik. The scheduler "Drop Target Area" works fine when the scheduler IS NOT being grouped. However in grouped mode, the method "slotByPosition(left, right)" is always returning null.

function createDropArea(scheduler) {
  scheduler.view().content.kendoDropTargetArea({
    filter:
".k-scheduler-table td, .k-event",
    drop:
function (e) {
       var grid = $("#grid").data("kendoGrid");
       var sch = $("#" + scheduler.element[0].id).data("kendoScheduler");
       var offset = $(e.dropTarget).offset();
       var slot = sch.slotByPosition(offset.left, offset.top);
       var dataItem = grid.dataItem(grid.select());
       if (dataItem && slot) {
         var offsetMiliseconds = new Date().getTimezoneOffset() * 60000;
         var newEvent = {
            title: dataItem.Name,
            end:
new Date(moment(slot.endDate).add('minutes', 30)),
            start: slot.startDate,
            isAllDay: slot.isDaySlot,
            jobId: dataItem.Id,
         };
         scheduler.dataSource.add(newEvent);
         scheduler.dataSource.sync();
       }
    }
});}
Atanas Korchev
Telerik team
 answered on 15 Aug 2014
4 answers
293 views
General goal here is to have a searchable dropdownlist that:

1. Doesn't request all records from the server when it first loads.
2. Allows me to control the number of characters entered in the search box before the server filter is fired.
3. I don't know what Angular directive is used to make the dropdown show the filter ... k-filter ?  filter ?

<input id="customerSearch" placeholder="Search Customer"
                           kendo-widget-name="customerSearch"
                           kendo-drop-down-list
                           k-on-select="customer_select(kendoEvent)"
                           k-suggest="true"
                           k-height="100"
                           k-data-text-field="'customer.name'"
                           k-data-value-field="'id'"
                           k-data-source="customerSearchDataSource"
                           filter="startswith"
                           ng-model="search"
                           k-template="'<span>${ data.customer.name }</span>'">
Atanas Korchev
Telerik team
 answered on 15 Aug 2014
7 answers
260 views
The issue I have is with the tabstrip in a footer on ios devices with view transition slide. When you try to navigate quickly through the views the tabs can get 'stuck'. It seems to me that the mouse-up event doesn't fire because the tab you touch stays highlighted. Then when you try clicking it again it fires the click event twice consecutively. This behavior does not seem to occur on android devices.

I've created an example jsbin to help with replicating the issue, just be aware that it takes a few goes of flicking between the 2 views quickly to cause the issue - you have to touch the tabstrip at precisely the right time as soon as a view shows. And make sure you run it on an ios device; I've been testing with an iPad mini.

The attached screenshots show what happens when the issue occurs.

Regards
Dean
Dean
Top achievements
Rank 1
 answered on 14 Aug 2014
9 answers
442 views
How do I combine two series into one legend item? I want to place error bars "onto" a stacked area series. Since the stacked area messes up the placement of the error bars, I cannot put them on the same series. But I do want to be able to toggle them off and on together.
Micah
Top achievements
Rank 1
 answered on 14 Aug 2014
3 answers
723 views
Hi!
The new kendoui grid feature of the filter row is a great improvement to the grid! We are trying to use it on our project but it seems that the filter input boxes can't seem to handle small column widths. We tried configuring the width of the input using the configuration columns.filterable.cell.inputWidth but seems to make no difference. Tried it in the kendoui documentation example here: http://dojo.telerik.com/UxUr but changing the number doesn't seem to change anything.

Any suggestions?
Iliana Dyankova
Telerik team
 answered on 14 Aug 2014
1 answer
94 views
Hello,

When opening the mobile device's "column settings" menu, the label above the "sort ascending, descending, etc." options is the column id.

As this makes no sense in my application, I need to replace this id with the column name. Is there some built-in option, or could you provide a workaround?

Thanks
Alexander Valchev
Telerik team
 answered on 14 Aug 2014
3 answers
1.1K+ views
I suspect this question has already been asked and answered elsewhere in the forum, and, it might be more about JSON than the grid.

I am using the MVC wrappers to build a grid.  The grid has two “date only” (no time) fields.  I am using the Kendo DatePicker widget, but I suspect this is more appropriately a grid question.  The grid is using .Ajax() for CRUD operations (which uses JsonResult). 
     Ex:  return Json(new[] { m }.ToDataSourceResult(request, ModelState));

When the server and the user are in two different time zones, I get a displayed date that is off by one day.  I assume this is because the time is midnight, and the time zone adjustment is turning midnight on the 15th into 11pm on the 14th  (for example).

I tried sending UTC DateTime, but that did not work:
     m.StartDate = m.StartDate.ToUniversalTime();

Is there a standard solution for this?  I have seen a lot of writeups related to this issue, but most of them don’t directly address Kendo Grid using MVC wrappers and Ajax calls.

Thanks,
R
Alexander Popov
Telerik team
 answered on 14 Aug 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
Application
Drag and Drop
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
ListBox
DropDownTree
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
PivotGridV2
Licensing
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
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?