Telerik Forums
Kendo UI for jQuery Forum
1 answer
318 views

I am trying to load the grid state from the json that is saved when saving grid state.  I am using `JSON.parse(text)` text being my json.  The actual code works everywhere else but the unexpected token # in json is causing issues.

 

This is the specific area that is causing the issue

columns.Template(@<text>
 
            </text>)
                      .Title("Actions")
                      .ClientTemplate(
                          "<a href='" + @Url.Action("EditTime", "TimePunches", new { id = "#=ID#", flt = @ViewBag.FLT }) + "' title='Edit'><i class='icon-edit fa fa-pencil fa-fw fa-lg'></i></a>" +
                        "<a href='" + @Url.Action("PunchLogIndex", "TimePunches", new {id = "#=ID#", flt = @ViewBag.FLT}) +"' title='Punch Log'><i class='icon-purple fa fa-book fa-fw fa-lg'></i></a>" +
                        "<a href='" + @Url.Action("PunchRequestIndex", "TimePunches", new { punchId = "#=ID#", flt = ViewBag.FLT }) + "' title='See Change Request Log'><i class='icon-niagara fa fa-list fa-fw fa-lg'></i></a>" +
                        "<a href='\\#' id='delete' data-id='#=ID#' data-client='#=ClientID#'><i class='icon-red fa fa-times fa-fw fa-lg'></i></a>").Width(150).HeaderHtmlAttributes(new { @class = "header-center" });

 

It's my understanding that the razor text attributes are not liked when loading grid state. Is there a way to load this template in after the fact?

Dan
Top achievements
Rank 1
 answered on 18 Jan 2017
5 answers
111 views
I'm developing an MVC 4 app that uses Windows Authentication on my domain. When the user goes to the root address on their iOS device they are presented with the standard log in box (because they aren't joined to the domain). When the log in everything is great and the apps works fine.

I want my users to be able to add a home screen icon for the app. Doing so gives us a great looking app experience but every time it's re-launched it starts back at the login screen and at the default view of the app.

So, I need to do one of the two:

1. Figure out a way to make the independent app remember its state and keep it authenticated or...
2. Force the home screen icon to open in Safari rather than it's own independent window.
Stefan
Telerik team
 answered on 18 Jan 2017
5 answers
1.1K+ views

I am having trouble with some Site CSS box-sizing interfering with the Kendo DatePicker.

The problem is some standard CSS is globally applied to all text inputs with the following CSS:

input[type="text"], input[type="password"] {
      border-color: #cdcdcd;
      border-style: solid;
      border-radius: 3px;
      border-width: 1px;
      border-radius: 3px;
      height: 32px;
      padding: 8px 8px 8px 8px;
      box-sizing: border-box; /* Remove this, date picker displays ok but text box too big */
    }

This causes a grey line to appear at the bottom of the DatePicker which I want to get rid off.  The problem seems to stem from the box-sizing css property above.  Remove this, the grey area is removed.  However, the text input appears too big.

I have prepared a Dojo example for this:

http://dojo.telerik.com/@andez2000/eHEZA/17

Any help is appreciated

Iliana Dyankova
Telerik team
 answered on 18 Jan 2017
4 answers
669 views

We are migrating our application from the ASP.NET AJAX Grid, where we had the PageCount in the Pager-Message as stated here:

http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/functionality/paging/changing-the-default-pager/using-pagertextformat

{1} is total number of pages.

Unfortunately, the Pager of the Kendo Grid does not support the PageCount.

http://docs.telerik.com/kendo-ui/api/javascript/ui/pager#configuration-messages.display

Is there any workaround to get the pageCount in the pager?

Daniel Knoll
Top achievements
Rank 1
 answered on 18 Jan 2017
2 answers
881 views

i'm new with kendo-ui and mvc.

how can i implement a parent-child structure in kendo-grid with expand/collapse behavior?

we are currently using kendo-ui 2013.

hoping for your kind help.

thank you in advance.

christine
Top achievements
Rank 1
 answered on 18 Jan 2017
1 answer
388 views

hi,

I am opening an kendo window using the below jquery function.

However I need to pass __RequestVerificationToken to the MVC Controller because I am having "ValidateAntiForgeryToken" Attribute.

However, I am not able to pass it. Can you please suggest how to pass __RequestVerificationToken  while opening an kendoWindow

function OpenTest() {           

var url = '@Url.ActionWithArea("OpenTest", "Test", GlobalConst.AREA_EL_ElectiveEB)';

url += "?test=" +$("#test").val() +
"&test1=" +$("#test1").val();

 

    windowElement = $('<div id = "abc" />').kendoWindow({
    title: 'test',
    content: url,
    modal: true,
   resizable: false,
   draggable: false,
   width: 900,
   height: 400,
   close: function () { windowElement.destroy(); }
}).data("kendoWindow").center().open();

return false;

}

Boyan Dimitrov
Telerik team
 answered on 17 Jan 2017
3 answers
1.1K+ views

I'm using the example from http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/Editing/custom-delete-confirmation-dialog. From what I can see, the code appears almost identical, but when I click the delete command the default javascript dialog is still shown then the kendo.confirm(). If I then disable the confirmation using confirmation: false in the editable {}, the default confirmation dialog is not shown, but the destroy event is triggered before the kendo.confirm(). Is there a reason why I'm still getting the default confirmation dialog?

 

I've attached a gif screen capture of what I am seeing when clicking the delete command button.

 

var ds_addresses = new kendo.data.DataSource({
        autoSync: false,
        transport: {
            create: {
                url: url('common/ax_add_address'),
                dataType: "json",
                type: "post"
            },                     
            read: {
                url: url('common/ax_read_addresses/' + item.user_id),
                dataType: "json",
                type: "post",
                contentType: "application/json"
            },
            update: {
                url: url('common/ax_update_address/' + item.user_id),
                dataType: "json",
                type: "post"                                       
            },
            destroy: {
                url: url('common/ax_delete_address'),
                dataType: "json",
                type: "post"
            },
            parameterMap: function(options, operation) {
                if (operation !== "read" && options.models) {
                    return {models: kendo.stringify(options.models)};
                }
            }
        },
        batch: true,
        serverPaging: false,
        serverSorting: false,
        serverFiltering: false,
        pageSize: 10,
        schema: {
            model: {
                id: "address_id",
                fields: {
                    text: { editable: true, validation: { required: true } },
                    suburb: { editable: true, validation: { required: true }  },
                    postcode: { editable: true, validation: { required: true, max: 9020 } },
                    postal: { type: "boolean", editable: true }
                }
            },
            data: "data",
            total: "total"
        },
        error: function (e) {
            //kendo.alert(e.errors.join("; "));
        }
});
 
$("div.client-addresses").kendoGrid({
    dataSource: ds_addresses,
    scrollable: false,
    selectable: "row",
    sortable: false,
    pageable: false,
    toolbar: ["create"],                       
    columns: [
        { field: "address_id", hidden:true },
        { field: "text", title: "Address Text" },
        { field: "suburb", title: "Suburb", width: "200px" },
        { field: "postcode", title: "Postcode", width: "80px" },
        { field: "postal", title: "Postal?", width: "90px", template: "#= postal ? 'Yes' : 'No' #" },
        { command: [
            {name: "edit", text: " ", template: "<a class='k-button k-grid-edit' href='' style='min-width:16px;'><span class='k-icon k-edit'></span></a>" },
            {name: "delete", text: " ", template: "<a class='k-button k-grid-delete' href='' style='min-width:16px;'><span class='k-icon k-delete'></span></a>", click: function(e) {
 
                e.preventDefault(); //prevent page scroll reset
 
                var tr = $(e.target).closest("tr"); //get the row for deletion
                var data = this.dataItem(tr); //get the row data so it can be referred later
                 
                kendo.confirm("Are you sure you want to delete this address record?").then(function () {
                    grid.dataSource.remove(data)  //prepare a "destroy" request
                    grid.dataSource.sync()  //actually send the request (might be ommited if the autoSync option is enabled in the dataSource)
                }, function () {
                    //kendo.alert("You chose to Cancel action.");
                });                                
            }}                                                                                 
           ], title: "Action", width: "118px" }
    ], 
    editable: {
        mode: "inline"
    }, 
    change: function(e) {      
     
        var rows = this.select();
 
        if(rows.length > 0)
            $('#selected-controls').show();        
        else
            $('#selected-controls').hide();
    },                 
    noRecords: {
        template: '<div style="margin:20px">No address records present.</div>'
    }
});
Rachael
Top achievements
Rank 1
 answered on 17 Jan 2017
10 answers
455 views

In my code I am using the Diagram to show a series of options to a user, in a hierarchical format.  The data source gets its info from a web call, and the visual template is simply a rectangle and some text.  I create the diagram with the following options:

                    layout: {
                        type: "layered"
                    },
                    connectionDefaults: {
                        selectable: false
                    },
                    editable: false,
                    click: selectFunc

The "selectFunc" simply sees if the click occurred on an item, and if so, sets a variable to that item for later retrieval. 

What I want to be able to do is treat this diagram as single selection only.  So, how do I:

 

1) Disable mouse selection rectangle?  If you click and drag the mouse, a selection rectangle forms that will select all shapes it intersects.

2) Disable [CTRL]-Click, which allows multiple selection?  In my selectFunc method, I undo the multiple selection and only select the last clicked on item, but the user still sees the multi-select action occur.

3) Make the diagram resizable?  It seems if I do not specify an explicit width and height in CSS, the diagram will draw larger than the <div> it is contained within; and my attempts to use CSS to specify margins is also mostly ignored.

4) I utilize the "bringIntoView" method with a parameter of the first shape in the collection to make sure the diagram shows at least the first object in the hierarchy, but can I also specify to show it centered at the top of the available space?

 

Thanks in advance!

Vessy
Telerik team
 answered on 17 Jan 2017
2 answers
904 views

Is there any way to set the title in a Kendo Chart to an HTML template of some sort?
Basically I'm just looking to make the title of my Kendo Chart a link that will open another window. The version of the Kendo library we were using before had support for this functionality, but when updating to the most recent version of Kendo (2016.3.1118), I noticed that we lost this from when we were using the previous library.
Here's how I was declaring my chart title before.

$("#myChart").kendoChart({
    title: {
        text: '<a onclick="openWindow();">' + myChartTitleVar + '</a>',
        color: "black"
    },
    ...

Using jQuery I did find a work around, however with how I have my chart set up, it refreshes every couple of seconds to display new data, so my title doesn't persist, and it ends up going back to the original title that displays as &lt;a onclick="openWindow();"&gt;My Title&lt;/a&gt; when viewed in my inspector in Chrome.

$("#myChart > svg > g > g:eq(1) > g > text").html('<a onclick="openWindow();">' + myChartTitleVar + '</a>');
Kyle
Top achievements
Rank 1
 answered on 17 Jan 2017
1 answer
129 views

I have two dropdowns and a mvc kendo scheduler. I am trying to display the scheduler events based on two drop downs selections. Could you please help me? Here is the code

.DataSource(d=>
                 {

            d.Model(m =>
            {
                m.Id(f => f.TaskID);
            });
            d.Read(read =>
            {
                read.Action("schedulerDisplay", "")
                    .Data("passParameters");
            })
            .ServerOperation(true);
        })

<script>
function passParameters() {

        return {
            param1: $("#dropdown1").val(),
            param2: $("#dropdown2").val()
        };
    }
</script>

Nencho
Telerik team
 answered on 17 Jan 2017
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
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?