Telerik Forums
Kendo UI for jQuery Forum
5 answers
106 views

Hi,

I wasnt sure what category this question belongs as I dont know if the issue is Grid or DataSource related. So here it is.

I've created a kendoWindow that contains a KendoGrid with a height of 350px. The problem Im having is that the Grid is not maintaining the height (and impl scroll overflow) when the window is opened multiple times.

Here is the code, (apologies for its length, Im this one bug away from it being complete) http://dojo.telerik.com/uCayI

The problem persists regardless of is the dataSource is static or remote.

You can see the bug if you run the code then open either of the windows mulitple times, you'll see the lower buttons vanish.

Please ask if anything is unclear.

Regards, 
Grant

Rumen
Telerik team
 answered on 13 Sep 2016
2 answers
113 views
Using the latest version in combination with angular 1.5.8 using components it appears that the multi-select doesn't show anything when i use an ng-model binding.
I created an example at http://dojo.telerik.com/@Marcel/osoHA/2 to show you the problem.
I know i can use k-ng-model to successfully bind, but that raises other problems in my application due to custom directives that require ng-model, angular validation, etc.

Is this a known (broken) issue and is there a workaround to solve this problem ?
Dimiter Topalov
Telerik team
 answered on 13 Sep 2016
1 answer
129 views

Hello,

I have model that looks like

 public class VacUserSecurityModel
    {
        private bool isCurrentUser;

        public VacUserSecurityModel()
        {
            this.Claims = new List<UserClaim>();
        }    

        public string Id { get; set; }
        public string Email { get; set; }
        public string UserName { get; set; }
        [UIHint("ClaimsEditor")]
        public List<UserClaim> Claims { get; set; }
    }

Here is a grid 

@(Html.Kendo().Grid<VacUserSecurityModel>
    ()

    .Name("allGrid")
    .DataSource(datasource => datasource.Ajax().Read(read => read.Action("ReadAllUserClaims", "Authorization"))
    .Update(update => update.Action("UpdateUserClaims", "Authorization"))
    .Model(model =>
    {
        model.Id(p => p.Id);
        model.Field(p => p.UserName).Editable(false);
        model.Field<List<UserClaim>>(e => e.Claims);
    }))
    .NoRecords(x => x.Template("<div class='k-grid-norecords-template'>No records</div>"))
    .Editable(editable => editable.Mode(GridEditMode.PopUp))
    .HtmlAttributes(new { style = "height:550px;" })
    .Columns(columns =>
    {
        columns.Bound(c => c.Id).Visible(false).Title("ID");
        columns.Bound(c => c.UserName).Width(250).Title("User");
        columns.Bound(c => c.Claims).ClientTemplate("#=claimsTemplate(Claims)#");
        columns.Command(commands => { commands.Edit(); });
    })
)

Claims Editor:

@model  Models.Authorization.VacUserSecurityViewModel
@(Html.Kendo().MultiSelect()
    .Name("RoleClaims")
    .Placeholder("Select roles")
    .DataTextField("ClaimValue")
    .DataValueField("ClaimValue")
    .BindTo((System.Collections.IEnumerable) ViewData["RolesDictionary"]))

How do I need to change the grid definition to bind Claims property to be able to edit this collection? During update, Claims property has old values regardless what I select.

Any help will be appreciated.

Gerard
Top achievements
Rank 1
 answered on 13 Sep 2016
3 answers
297 views
Hi Team,

I am unable to bind Kendo ui grid from stored procedure using entity framework and I am able to bind kendo ui from table using entity framework.
PFB Code for bind

from table:
return tsmsent.TSMSDets
              .OrderBy(tsms => tsms.Task)
              .Select(tsms => new TimeSheetDetails
              {
                  Task = tsms.Task,
                  Day1 = tsms.Day1,
                  Day2 = tsms.Day2,
                  Day3 = tsms.Day3,
                  Day4 = tsms.Day4,
                  Day5 = tsms.Day5,
                  Day6 = tsms.Day6,
                  Day7 = tsms.Day7
              }).ToDataSourceResult(request.Take, request.Skip, request.Sort, request.Filter);

From Stored procedure:
return tsmsent.GetTimeSheet()
    .OrderBy(tsms => tsms.Task)
    .Select(tsms => new TimeSheetDetails
    {
        Task = tsms.Task,
        Day1 = tsms.Day1,
        Day2 = tsms.Day2,
        Day3 = tsms.Day3,
        Day4 = tsms.Day4,
        Day5 = tsms.Day5,
        Day6 = tsms.Day6,
        Day7 = tsms.Day7
    })
    .AsQueryable().ToDataSourceResult(request.Take, request.Skip, request.Sort, request.Filter);


kindly help me how to get this done using stored procedure.
thanks for advance.

Regards,
Mani

Genady Sergeev
Telerik team
 answered on 13 Sep 2016
6 answers
569 views

I'm writing an inventory system using mostly the Kendo UI Grid to process the invoicing system. When I'm creating a new invoice I need to create the invoice first, and then add the line items to the invoice and save it. I'm creating my invoice through an AJAX request and then using the create method of the DataSource to add the line items. I'm able to submit the invoice through my API and get back a response from the server with the newly created object, however how do I get the newly created object to interact with my Grid? Specifically I need the ID of the new invoice to add to the InvoiceID field of each of the line items of my Grid.

My thinking is that the best place to create the Invoice is in the saveChanges event of the Grid. Due to the asynchronous nature of JavaScript, which is somewhat new to me, how do I gt the object? Here is my code:

    $("#grid").kendoGrid({
        dataSource: {
            batch: false,
            transport: {
                create: {
                    url: ...
                    },
                    contentType: "application/json",
                    type: "POST"
                },
                parameterMap: function (data, operation) {
                    return JSON.stringify(data);
                }
            },
            schema: {
                data: "Data",
                total: "Total",
                model: {
                    id: "InvoiceID",
                    fields: {
                        InvoiceID: { editable: "false", type: "number" },
                        ClientID: { type: "number" },
                        LineItemID: { type: "number" },
                        ...
                    }
                }
            }
        },
        pageable: true,
        toolbar: ["create", "save", "cancel"],
        columns: [
            { ... },
            { command: ["edit", "destroy"], width: "300px" }],
        editable: true,
        save: function(e) {
            ...
            }
        },
        saveChanges: function (e) {
            newInvoice = CreateInvoice();
 
        }
    });
 
    });
});
 
function CreateInvoice() {
    invoice = {
        ClientID: $('#ClientID').text(),
        Status: 1,
        ...
    };
 
    $.ajax({
        url: '/api/invoice/',
        type: 'POST',
        data: JSON.stringify(invoice),
        contentType: "application/json",
    });
};

The invoice is created successfully and I need to take the ID of that object and apply it to the line items of each row in the Grid. What is the best way of doing this?

 

 

 

Stephen
Top achievements
Rank 2
 answered on 13 Sep 2016
1 answer
212 views

Hello,

i have problem with kendo MVC Grid with presist state. After I load grid setting from localStorage (Grid is grouped by Subject column) and click on filter icon in column which has enabled MultiCheckbox filtering (DP or ZS) , I got this error in js console:

VM643:3 Uncaught ReferenceError: DruhPrijmu_Code is not defined(anonymous function)@ VM643:3render @ kendo.all.js:175proxy @ jquery-1.10.2.js:841createCheckBoxes @ kendo.all.js:34934refresh @ kendo.all.js:34901proxy @ jquery-1.10.2.js:841trigger @ kendo.all.js:124_process @ kendo.all.js:6882success @ kendo.all.js:6627success @ kendo.all.js:6555n.success @ kendo.all.js:5547fire @ jquery-1.10.2.js:3062fireWith @ jquery-1.10.2.js:3174done @ jquery-1.10.2.js:8249callback @ jquery-1.10.2.js:8792XMLHttpRequest.send (async)send @ jquery-1.10.2.js:8720ajax @ jquery-1.10.2.js:8150read @ kendo.all.js:5549read @ kendo.aspnetmvc.js:250(anonymous function) @ kendo.all.js:6552_queueRequest @ kendo.all.js:6742read @ kendo.all.js:6545query @ kendo.all.js:6925_query @ kendo.all.js:6956sort @ kendo.all.js:7013_click @ kendo.all.js:36725proxy @ jquery-1.10.2.js:841dispatch @ jquery-1.10.2.js:5109elemData.handle @ jquery-1.10.2.js:4780

After this error grid stop work...

This is problem occurs only with multicheckob filtering column.

This is a my sample code:

 

@(Html.Kendo().Grid<Playground.Models.ODU.ODUZaznamViewModel>()
                                .Name("GridODU")
                                .Columns(columns =>
                                {
                                    columns.Bound(item => item.Subjekt_Id).Width(120).Title("ID subjektu");
                                    columns.Bound(item => item.Subjekt_ObchodniNazev).Width(220).Title("Subjekt");
                                    columns.Bound(item => item.DruhPrijmu_Code).Width(120).Title("DP").Filterable(ftb => ftb.Multi(true).Search(true));
                                    columns.Bound(item => item.ZuctovaciSymbol_Code).Width(120).Title("ZS").Filterable(ftb => ftb.Multi(true).Search(true));
 
                                })
                                .DataSource(dataSource => dataSource
                                    .Ajax()
                                    // .Batch(false)
                                    .ServerOperation(true)
                                    .Events(events => events.Error("error_handler"))
                                    .PageSize(20)
                                    .Model(model =>
                                    {
                                        model.Id(p => p.ID);
                                    })
                                    .Read(read => read.Action("ODURead", "Home"))
                                   )
                                .Scrollable()
                                .ColumnMenu()
                                .Events(x => x.DataBound("saveState"))
                                .Groupable()
                                .Filterable() // ftb => ftb.Mode(GridFilterMode.Row)
                                              // .Events(e => e.ColumnMenuInit("columnMenuInit"))
                                .Reorderable(x => x.Columns(true))
                                .Pageable() // Enable paging
                                .Sortable() // Enable sorting
                                .Resizable(resize => resize.Columns(true))
)
 
 
<script type="text/javascript">
    function error_handler(e) {
        if (e.errors) {
            var message = "Errors:\n";
            $.each(e.errors, function (key, value) {
                if ('errors' in value) {
                    $.each(value.errors, function () {
                        message += this + "\n";
                    });
                }
            });
            alert(message);
        }
    }
 
    function saveState(e) {
        e.preventDefault();
        localStorage["kendo-grid-options"] = kendo.stringify($("#GridODU").data("kendoGrid").getOptions());
    };
 
    $(function (e) {
        var options = localStorage["kendo-grid-options"];
        if (options) {
            $("#GridODU").data("kendoGrid").setOptions(JSON.parse(options));
        } else {
            $("#GridODU").data("kendoGrid").dataSource.read();
        }
    });
</script>

 

Model:

namespace Playground.Models.ODU
{
    public class ODUZaznamViewModel
    {
        public long ID { get; set; }
        public virtual int Subjekt_Id { get; set; }
        public string Subjekt_ObchodniNazev { get; set; }
        public virtual string DruhPrijmu_Code { get; set; }
        public virtual string ZuctovaciSymbol_Code { get; set; }
    }
}

 

It is a bug ?

The problem detected in this versions of KENDO

Kendo UI version: "2016.1.412"

Kendo UI version: "2016.2.714"

.

Thanks for help !

Ianko
Telerik team
 answered on 13 Sep 2016
1 answer
882 views

I'm not sure I'm totally getting The Kendo Way of the doing things yet. My instinct is to get the data I need from the grid, do what I need with it, then manually update the grid. It seems to me, the grid want to be the single point of truth for data and functions.

I am using server-side paging with an API. The API can cope with pageSize and page parameters, which are defined in the grid. That means I am only ever seeing, say, 20 records at a time. To do this, the read function has an options param that "magically" contains pageSize and page.

vm.masterGrid.dataSource = new kendo.data.DataSource({
    pageable: {
        pageSizes: true,
        buttonCount: 5
    },
    pageSize: 20,
    serverPaging: true,
    serverSorting: true,
    serverFiltering: true,
    transport:{
        read: function(options) {
                return vm.getOrders(options);
            }
        },
    }
});

I want to be able to check one or several or all, or even all-minus-one orders, and send them "down the pipe".
Each row has a checkbox, and then there is a 'Select All' button.

Since the grid only sees a small window of data, I don't think I can keep track of all order states in the front end. (If I'm on page one, the grid knows nothing about any orders except the first 20).

So, my solution is to have a separate end-point: api/orders/selectall. It has no params (except pageSize and page) and simply tells the back end to flag all orders as 'in-progress'. Upon return, it needs to deliver tohse 20 records and tell the grid to refresh.

So my question(s), after all that is/are:
How does my select all button interact with the grid?

 

I need to 

  1. get that options item (below, I'm faking it)
  2. make the call via my api, and stuff the new data back into the grid

Do I call read()? How? I'm outside the grid. vm.masterGrid.dataSource.read()?

  1. vm.selectAll = function () {
        console.log(vm.masterGrid.gridOptions)
        var  options = {
            data: {
                pageSize: 20,
                page: 1
            }
        };
        vm.selectAllOrders(options);
    };
Boyan Dimitrov
Telerik team
 answered on 13 Sep 2016
4 answers
1.2K+ views
How do I remove menus that appear when you right click on the spreadsheet widget.
Jack
Top achievements
Rank 2
Iron
 answered on 13 Sep 2016
1 answer
109 views

Hi, 

we develope an application with Kendo mobile and we use the router for navigation :                            

router.navigate("viewPath");

In application there is a situation when we need to submit a saving dialog to navigate to other view. Sometimes in this case occures a problem that the application just flashes like it was navigated to the next view (also in code it is acting like that) but the previous view is freezed on the top.

For example you have an app with views:

some home page -> products view -> product detail

- I navigate from home page to products view and to specific product - when I want to save a product detail a dialog is shown - I submit the saving and it should go back to products view. But it doesnt. When I use a native android back button it flashes and seems to navigate to products view for a second but still the product detail is freezed on the window after that (if you press native back buttons more times it asks if you want to close the app like you were on the home page).

Is it possible to solve the navigation some other way to avoid this problem? 

Thank you in advance.

 

 

 

Ianko
Telerik team
 answered on 13 Sep 2016
4 answers
287 views
This is regarding bug with Kendo MultiSelect control.
We have updated kendo UI version from 2014.3.1411 to 2016.1.226
Below code was working fine with version 2014.3.1411 for kendo multiselect (It was able to perform below operations)
1. set pre-loaded value in kendo multiselect
2. data filtering while typing in kendo multiselect.

  ms = $(this).kendoMultiSelect({
                itemTemplate: inlineTemplate,
                tagTemplate: tagTemplate,
                delay: 200,
                placeholder: placeHolder,
                minLength: 3,
                maxSelectedItems: maxSelects,
                autoBind: true,
                change: change,
                select: select,
                dataSource: preSelected,
                dataValueField: returnField,
                value: preSelectedObjectSids,
               dataTextField: "DisplayName"               
            }).data("kendoMultiSelect");
    ms.setDataSource(ds);

Now, The above operations has stopped working due to upgrade in its version to 2016.1.226

Tried to set multiselect value i.e. ms.value(preSelectedObjectSids) but it doesn't work.

when i remove  ms.setDataSource(ds) from above code, kendomultiselect holds the pre-loaded value but then it changes the entire datasource to single pre-loaded value. Obviously i cannot search or set any other value further in the multiselect

Is this known issue in latest kendo UI version 2016.1.226?

Could you suggest what i can try to fix this problem?
Matt Dufrasne
Top achievements
Rank 1
 answered on 13 Sep 2016
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
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
Licensing
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
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
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?