Telerik Forums
Kendo UI for jQuery Forum
2 answers
284 views
Dear support

Having a grid with multiple columns that is configured to single column sorting mode, I discovered that as soon as the grid is sorted by one column, the other columns get completely unordered.

Please see the attached image for an example

What I want to achieve is that even if the user actively sorts by one column (through clicking on the header), the other columns still have some meaningful (e.g. ascending) order.

So my question is:

Is it possible to tell a grid with single sort and client-side sorting to sort the other columns, too?

Thanks
Uwe

(Update: The original image was misleading, I added a better one)
Uwe
Top achievements
Rank 1
 answered on 16 Nov 2012
5 answers
679 views
Hi,
I have the following code which is far as I can tell as per the documentation and examples but the listview always appears empty.
My View is as follows
@model iProjX.Models.RolesModel
@using iProjX.Models;
 
<script type="text/x-kendo-tmpl" id="rolesList">
    <h3> ${Id} ${Description}</h3>
</script>
 
<div id="listView"></div>
<div class="k-pager-wrap">
    <div id="pager"></div>
</div>
 
 
<script type="text/javascript">
    var projectId = @(Html.Raw(Model.ProjectId));
 
    var sharedDataSource = new kendo.data.DataSource({
        transport: {
                read: {
                    url: "http://localhost:1278/Project/getRoles",
                    type: "POST"
                }
        },
        change: function (data) {
            debugger;
            alert("success ");
        },
        error: function (xhr, error) {
            debugger;
            alert("error ");
        },
        pageSize: 3
    });
 
    //Configure the List
    $("#listView").kendoListView({
        pageable: true,
        selectable: true,
        navigatable: true,
        template: kendo.template($("#rolesList").html()),
        dataSource: sharedDataSource
    });
 
    //Configure the Pager
    $("#pager").kendoPager({
        dataSource: sharedDataSource
    });
      
</script>

 

And my controller contains

public JsonResult getRoles([DataSourceRequest] DataSourceRequest request)
{
    var projectId = 113;
    using (LocationRepositry _locationRepository = new LocationRepositry())
    {
        IEnumerable<myLocation> Locations = _locationRepository.getByProjectId_Simple(projectId).Select(p =>     new     myLocation()
        {
            Id = p.Id,
            Description = p.Description
        }).ToList();
        return Json(Locations.ToDataSourceResult(request));
     }
}

And myLocation is

public class myLocation
{
    public myLocation() {}
 
    public Int64 Id { get; set; }
    public String Description { get; set; }
}

Now, with this implementation my controller function getRoles is hit and I can see the data returned from the server via browser tools as below.

Data returned from server
{"Data":[{"Id":132,"Description":"Location 1"},{"Id":133,"Description":"Location 2"},{"Id":134,"Description":"Location 3"},{"Id":135,"Description":"Location 4"}],"Total":4,"AggregateResults":null,"Errors":null}

The change function on the datasource is then subsequently hit but the data parameter returned contains an empty set of Data items as below (taken from visual studio immediate window).

?data
{...}
    items: []
    sender: {...}
    preventDefault: function(){g=!0}
    isDefaultPrevented: function(){return g}



If I change my controller to return without using the ToDataSourceResult extension it actually will work.
    return Json(Locations);

However, is this then the correct implementation or have I done something else wrong? And would this have an effect on how paging works?

Any help would be much appreciated.
Thanks

 

 

 

sapan
Top achievements
Rank 1
 answered on 16 Nov 2012
0 answers
135 views
evaluating kendo ui

on OSX with Safari 4

using free download files dated 10 July 12 viz. kendoui/examples/web/dropdownlist/index.html

if you duplicate the 4 no. cap size options twice to give 12 options the scrollbar is displayed but locked.

similar lock happens for combobox / autocomplete / timepicker with when scrollbar added

can this be fixed ?

1.
if you show the display:none list with $("#dropdownlist-list").show() the scrollbar is working

2.
possible workaround is to replace scrollbar

$("#dropdownlist-list").css({width:100}).jScrollPane(); which does not display scrollbar

$("#dropdownlist-list").mouseenter(function(){

$(this).css({width:100}).jScrollPane();

}).mouseleave(function(){

$(this).hide();
});
Michael
Top achievements
Rank 1
 asked on 16 Nov 2012
1 answer
235 views
Just noticed a small bug in validating a checkbox. 

To replicate in demo:
1. tab to checkbox
2. click checkbox with mouse

Result: A checked box with error message (as if it wasn't checked).
Rosen
Telerik team
 answered on 16 Nov 2012
0 answers
107 views
Hi,
Can i create a DropDown Menu how KendoUI Menu Products ??

Vitantonio
Top achievements
Rank 1
 asked on 16 Nov 2012
0 answers
99 views
Hi,

I'm currently populating a label with the values entered into a numerictextbox, i can get the numeric values fine, but i would like to retrieve it together with the formatting as well. eg. numerictextbox showing $1,234.00 should be retrieved as displayed into a label. Thanks.
Justin
Top achievements
Rank 1
 asked on 16 Nov 2012
1 answer
86 views
Hi,

I tried the Kendo Grid (2012.2.710) with the following example for MVC 4. However, the command button Add New Record does not work (not effect when mouse over, click nothing happens) for Firefox, but it works for Chrome. But if it is plain html , it works fine for both.

I am not sure what could be problem? Appreciate if someone can help.

Thanks

 <div id="example" class="k-content">
            <div id="grid"></div>


            <script>
                $(document).ready(function () {
                    var crudServiceBaseUrl = "http://demos.kendoui.com/service",
                        dataSource = new kendo.data.DataSource({
                            transport: {
                                read: {
                                    url: crudServiceBaseUrl + "/Products",
                                    dataType: "jsonp"
                                },
                                update: {
                                    url: crudServiceBaseUrl + "/Products/Update",
                                    dataType: "jsonp"
                                },
                                destroy: {
                                    url: crudServiceBaseUrl + "/Products/Destroy",
                                    dataType: "jsonp"
                                },
                                create: {
                                    url: crudServiceBaseUrl + "/Products/Create",
                                    dataType: "jsonp"
                                },
                                parameterMap: function (options, operation) {
                                    if (operation !== "read" && options.models) {
                                        return { models: kendo.stringify(options.models) };
                                    }
                                }
                            },
                            batch: true,
                            pageSize: 30,
                            schema: {
                                model: {
                                    id: "ProductID",
                                    fields: {
                                        ProductID: { editable: false, nullable: true },
                                        ProductName: { validation: { required: true } },
                                        UnitPrice: { type: "number", validation: { required: true, min: 1 } },
                                        Discontinued: { type: "boolean" },
                                        UnitsInStock: { type: "number", validation: { min: 0, required: true } }
                                    }
                                }
                            }
                        });


                    $("#grid").kendoGrid({
                        dataSource: dataSource,
                        pageable: true,
                        height: 400,
                        toolbar: ["create"],
                        columns: [
                            "ProductName",
                            { field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "150px" },
                            { field: "UnitsInStock", title: "Units In Stock", width: "150px" },
                            { field: "Discontinued", width: "100px" },
                            { command: ["edit", "destroy"], title: "&nbsp;", width: "210px" }],
                        editable: "inline"
                    });
                });
            </script>
        </div>


tritue
Top achievements
Rank 1
 answered on 16 Nov 2012
3 answers
332 views
Hopefully this is an easy one :)

I have a "Membership" Controller that serves up a WebsiteUser obect defined as so:
public class WebsiteUser
{
    public string UserName { get; set; }
    public DateTime LoginTime { get; set; }
    public bool IsLoggedIn { get; set; }
}

This is served up from the Membership/Index route:

       
public ActionResult Index()
{
    List<WebsiteUser> Users = new List<WebsiteUser>();
    foreach (MembershipUser user in Membership.GetAllUsers())
    {
        Users.Add(
            new WebsiteUser()
            {
                UserName = user.UserName,
                IsLoggedIn = user.IsOnline,
                LoginTime = user.LastActivityDate
            });
    }
    return View(Users);
}


Which is populated thusly:
@model IEnumerable<ATFWebsite.Controllers.WebsiteUser>
 
@{
    ViewBag.Title = "Index";
}
 
<h2>Membership</h2>
 
@(Html.Kendo().Grid(Model)   
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.UserName).Groupable(false);
        columns.Bound(p => p.IsLoggedIn);
        columns.Bound(p => p.LoginTime);
    })
    .Groupable()
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("Index", "Membership")
        )
    )
)


It all works quite nicely until I try to do paging, sorting or other ajax calls. The grid simply empties.

Whacking a breakpoint on the Index() call the page is definitely calling it back, but we're not getting the data. I assume I'm doing something elementary wrong here, unfortunately the Razor guides are still a little sparse on the ground and I'm having trouble finding a Razor example that does what I need.
Nathan
Top achievements
Rank 1
 answered on 15 Nov 2012
0 answers
119 views
Hello,

I was wondering if it is possible to have both popup editing and a dropdown editor in the same line in a grid. For instance;

...
columns: [ 
   { field: "ID", editor: devDropDownEditor, template: "#= selectID #" }, 
   { field: "Notes"}, 
   { command: "edit", width: 85}, 
],
editable: {mode: "popup", template: $("#popupTemplate").html()}
});

I have the dropdown editor working perfectly when the edit mode is incell. However, it does not work when the edit mode is popup, which is required for the rest of the grid. How can I get both working?

Thanks for your time.
Trevor
Top achievements
Rank 1
 asked on 15 Nov 2012
0 answers
77 views
i need help with this, im trying to make a area char with sources coming of a sql database y have a wcf service,  and the chart dont show me nothing

<div id="GAreaCPagos" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
    </div>
    <script type="text/jscript">


        function graficaCPagos() {

            $("#GAreaCPagos").kendoChart({
                theme: $(document).data("kendoSkin") || "default",
                dataSource: {
                    schema: {
                        data: "d", 
                        model: { 
                            fields: {
                                IDPAGOS: { type: "number" },
                                CANTPAGOS: { type: "number" }
                            }
                        }
                    },


                    transport: {


                        read: {
                            url: "ServicePagos.svc/ObtenerPagos",
                            contentType: "application/json; charset=utf-8", 
                            type: "POST" 
                        }
                    }
                },


                title: {
                    text: "Cantidad de Pagos",
                    color: "#848484"
                },


                legend: {
                    visible: true
                },


                seriesDefaults: {
                    type: "area"
                },


                series: [{ field: "CANTPAGOS"}],
                valueAxis: {
                    labels: {
                        format: "{0}"
                    }
                },


                categoryAxis: {
                    field: "IDPAGOS"
                },
                tooltip: {
                    visible: true,
                    format: "{0} Id"
                }
            });
        }

        $(document).ready(function () { var x = 0; graficaCPagos(); })
        
        
    </script>

help me please
David
Top achievements
Rank 1
 asked on 15 Nov 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
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
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?