This is a migrated thread and some comments may be shown as answers.

[Solved] GridOperationMode.Client loses icons

5 Answers 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
James
Top achievements
Rank 1
James asked on 19 Mar 2012, 04:52 PM

The Telerik grid no longer displays the icon on the custom command button whenever sorting or filtering is done.  This only appears to happen when the GridOperationMode is set to client.  As if it doesn't cache the icon sprite.

Using version 2011.3.1306 in case this has been corrected in another version.

@(Html.Telerik().Grid(Model.noWO)
        .Name("NoWriteOffGrid")
        .DataKeys(keys => keys.Add(x => x.ID))
        .DataBinding(binding =>
            {
                binding.Ajax()
                    .OperationMode(GridOperationMode.Client)
                    .Select("SelectPatient", "Home", new
                    {
                        facility = (string)ViewData["facility"],
                        MRN = (string)ViewData["MRN"]
                    });
            })
        .Columns(columns =>
            {
                columns.Command(commands =>
                {
                    commands.Custom("Create Packet").Action("WriteOff", "Home")
                        .Text("Create Packet")
                        .ButtonType(GridButtonType.ImageAndText)
                        .ImageHtmlAttributes(new { @class = "t-icon t-add" })
                        .DataRouteValues(values =>
                        {
                            values.Add(o => o.MRN).RouteKey("MRN");
                            values.Add(o => o.facID).RouteKey("FacilityID");
                        });
                }).Width(140);
                columns.Bound(x => x.LastName).Width(150).Title("Last Name");
                columns.Bound(x => x.FirstName).Width(150).Title("First Name");
                columns.Bound(x => x.MRN).Width(150).Title("MRN");
                columns.Bound(x => x.facID).Width(150).Title("Facility");
            })
        .Sortable(sorting => sorting
            .SortMode(GridSortMode.MultipleColumn)
            .OrderBy(or => or.Add(o => o.MRN).Ascending())
            .OrderBy(or => or.Add(o => o.facID).Ascending())
        )
        .Filterable()
        .Pageable(paging => paging.Enabled(true).Position(Telerik.Web.Mvc.UI.GridPagerPosition.Bottom).PageSize(10))
    )

5 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 22 Mar 2012, 02:23 PM
Hello James,

Does the issue persist when you update to the latest version? Everything is working fine in our online demo.

Kind regards,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
James
Top achievements
Rank 1
answered on 22 Mar 2012, 02:33 PM
The online demo doesn't have an icon though.  Add a button to that and you will see this issue.
0
Petur Subev
Telerik team
answered on 26 Mar 2012, 11:34 AM
Hello again James,

I added a custom command button to the columns but I still do not experience any issues. Could you please prepare a sample project which replicates the problem and send it so I can check for a solution?
Thank you for the cooperation.

Kind Regards,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
James
Top achievements
Rank 1
answered on 26 Mar 2012, 02:28 PM
Sample project folder is attached.
0
Petur Subev
Telerik team
answered on 27 Mar 2012, 02:09 PM
Hello again James,

Thank you for bringing this to our attention. It seems the classes are not properly added to the element representing the image. 
For now you can use the following work-around.
function onRowDataBound(e) {
        $(e.row).find('.t-grid-CreatePacket span').addClass('t-add');
}


Kind Regards,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Grid
Asked by
James
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
James
Top achievements
Rank 1
Share this question
or