Telerik Forums
Kendo UI for jQuery Forum
2 answers
143 views
Greetings,
I have a problem occurring when I add a tooltip to an anchor in a grid cell. The column widths are ignored and rendered spaced evenly when I explicitly set their width in the grid config.

I have a grid defined as follows:

@(Html.Kendo().Grid<SomeCollection>()
    .Name("grdTest")
    .Columns(columns =>
    {
        columns.Bound(t => t.Column1).Width(25).Title("Column1")
           .ClientTemplate("#if(Param1!=null){# <a class='locationLink' href='javascript:void(0)'data-param1='#=Param1#' data-param2='#=Param2#'>#=Column1#</span> #} else {##}#");
        columns.Bound(t => t.Column2).Width(100).Title("Column2");   
    })
    .DataSource(dataSource => dataSource
       .Ajax()
       .PageSize(100) 
       .Read(read => read.Action("MyMethod", "MyController", @Model))
       .ServerOperation(true)                     
    )       
    .Pageable()
    .Scrollable(s => s.Height("auto"))
    .Reorderable(reorder => reorder.Columns(true))       
    .Resizable(resize => resize.Columns(true))
    .Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn).AllowUnsort(true))
    .Navigatable()
    .Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
    .Sortable()      
)


I need to attach a popup to column1's hyperlink. I am doing this in the load function as follows:

<script type="text/javascript">
 
$(document).ready(function () {
 
    var grid = $("#grdTest").kendoGrid().data("kendoGrid");
 
    grid.table.kendoTooltip({
        filter: "a.locationLink",
        position: "top",
        width: 500,
        height: 250,
        content: {
            url: '@Url.Action("PopupViewContentMethod","Controller")'
        },
        requestStart: function (e) {
            e.options.data = {
                parameter1: $(e.target[0]).attr("data-parameter1"),
                paremeter2: $(e.target[0]).attr("data-parameter2")
            }
        }
    });
});
</script>



I narrowed down a problem to the code I added for the tooltip above. When I remove it my columns are rendered with the with I set in the configuration. When I add the popup code then the columns become evenly spaced with a ellipse on column overflows.

Any Ideas?
Ross B.
Top achievements
Rank 1
 answered on 12 Jun 2014
1 answer
317 views

 

Hi!
I want to fill a grid with a complex json returned from a webservice.
My json contains two things:
> "data": array with the records that will fill the grid
> "columns": array with the config(layout) of the grid

I have successfully filled the grid with the "data" by specifying the model data.
My problem is that i cannot  get the "columns" from the datasource. Is there a way to do it?

Here is my JSON
001.{
002.    "data": [
003.        {
004.            "id": 0,
005.            "firstname": "Hudson",
006.            "lastname": "Lynn",
007.            "gender": "male",
008.            "email": "hudsonlynn@emtrak.com",
009.            "phone": "699-434-2739",
010.            "address": "70 Delmonico Place, Roberts, New York",
011.            "birthday": "03/07/1968",
012.            "currency": "CHF"
013.        },
014.        {
015.            "id": 1,
016.            "firstname": "Michelle",
017.            "lastname": "Stanton",
018.            "gender": "female",
019.            "email": "michellestanton@emtrak.com",
020.            "phone": "699-374-6225",
021.            "address": "55 Gotham Avenue, Makena, Maryland",
022.            "birthday": "14/03/1965",
023.            "currency": "CHF"
024.        },
025.        {
026.            "id": 2,
027.            "firstname": "Marsh",
028.            "lastname": "Reilly",
029.            "gender": "male",
030.            "email": "marshreilly@emtrak.com",
031.            "phone": "699-546-0025",
032.            "address": "22 Mayfair Drive, Westmoreland, Nevada",
033.            "birthday": "17/07/1988",
034.            "currency": "CAD"
035.        }
036.    ],
037.    "columns": [
038.        {
039.            "field": "firstname",
040.            "title": "Frist Name",
041.            "width": 200,
042.            "attributes": {
043.                "class": "",
044.                "style": "text-align: left;"
045.            },
046.            "headerAttributes": {
047.                "class": "table-header-cell",
048.                "style": "text-align: left;"
049.            }
050.        },
051.        {
052.            "field": "lastname",
053.            "title": "Last Name",
054.            "attributes": {
055.                "class": "",
056.                "style": "text-align: left;"
057.            },
058.            "headerAttributes": {
059.                "class": "table-header-cell",
060.                "style": "text-align: left;"
061.            }
062.        },
063.        {
064.            "field": "gender",
065.            "title": "Gender",
066.            "attributes": {
067.                "class": "",
068.                "style": "text-align: left;"
069.            },
070.            "headerAttributes": {
071.                "class": "table-header-cell",
072.                "style": "text-align: left;"
073.            }
074.        },
075.        {
076.            "field": "email",
077.            "title": "e-mail",
078.            "attributes": {
079.                "class": "",
080.                "style": "text-align: left;"
081.            },
082.            "headerAttributes": {
083.                "class": "table-header-cell",
084.                "style": "text-align: left;"
085.            }
086.        },
087.        {
088.            "field": "phone",
089.            "title": "Phone Number",
090.            "attributes": {
091.                "class": "",
092.                "style": "text-align: right;"
093.            },
094.            "headerAttributes": {
095.                "class": "table-header-cell",
096.                "style": "text-align: right;"
097.            }
098.        },
099.        {
100.            "field": "address",
101.            "title": "Address",
102.            "attributes": {
103.                "class": "",
104.                "style": "text-align: left;"
105.            },
106.            "headerAttributes": {
107.                "class": "table-header-cell",
108.                "style": "text-align: left;"
109.            }
110.        },
111.        {
112.            "field": "birthday",
113.            "title": "Birthday",
114.            "attributes": {
115.                "class": "",
116.                "style": "text-align: center;"
117.            },
118.            "headerAttributes": {
119.                "class": "table-header-cell",
120.                "style": "text-align: center;"
121.            }
122.        },
123.        {
124.            "field": "currency",
125.            "title": "Currency",
126.            "attributes": {
127.                "class": "",
128.                "style": "text-align: center;"
129.            },
130.            "headerAttributes": {
131.                "class": "table-header-cell",
132.                "style": "text-align: center;"
133.            }
134.        }
135.    ]
136.}


Here is how i fill the datasource
01.var customersSource = new kendo.data.DataSource({
02.        transport: {
03.            read: {
04.                url: crudServiceBaseUrl + "/customers.json",
05.                dataType: "json"
06.            }
07.        },
08.        schema: {
09.            data: "data"
10.        }
11.    });

Here is my gridOptions
1.$scope.mainGridOptions = {
2.        dataSource: customersSource,
3.        //columns: customersSource.columns???,
4.        height: 500,
5.        scrollable: true,
6.        selectable: true
7.    };



Atanas Korchev
Telerik team
 answered on 12 Jun 2014
5 answers
329 views
Some of the open source splitter plugins have a rememberme option that remembers the position of the splitters between page refreshes.  Normally they store this information in a cookie, but sometimes you can override and use localStorage instead.  Does the kendoSplitter have a similiar rememberme function?   Would it be difficult t write one?
Johannes
Top achievements
Rank 1
 answered on 12 Jun 2014
1 answer
487 views
I am using the NuGet package Rotativa which in trun uses wkhtmltopdf.exe in a MVC 4 web application to generate PDF barcode documents from a standard MVC view.  While QRcode and Code128 barcodes work fine, Code39 and Code93 do not.  

The code to invoke the view is:

return (new Rotativa.ActionAsPdf("PrintTrailerPage", new { id = id, barcodeType = Request.Params["barcodeType"] ?? "qrcode" }) { FileName = String.Format("Trailer Page for {0}.pdf", model.DocumentName, model.BarcodeValue, model.ID), PageSize = Rotativa.Options.Size.Letter, PageOrientation = Rotativa.Options.Orientation.Portrait, PageMargins = { Left = 0, Right = 0, Top = 0, Bottom = 0 } });

Curiously, PrintTrailerPage, which Rotativa invokes, always renders properly when displayed directly in the browser.  Do you have any ideas or insight that might help remedy this issue?
T. Tsonev
Telerik team
 answered on 12 Jun 2014
1 answer
191 views
Is there a way in kendo tabstrip(mobile) for horizontal swipe in latest version.

I am looking for similar feature as mentioned in post @http://www.telerik.com/forums/swipe-scrolling-tabstrip
Kiril Nikolov
Telerik team
 answered on 12 Jun 2014
1 answer
3.0K+ views
Hi there,

I'm using a masked text box as an incell editor for a grid.  I want to right-align the value in the editor field.  Please see the attached PNG file for how it looks currently.  I tried adding a class to the input field that right-aligned the value, but this right aligned the value+spaces to the right.  I'd like the last digit in the value to be over to the right edge of the input.

Pertinent code is:

columns: [
                  {
                      field: "accounting_category",
                      title: "CATEGORY"
                  },
                  {
                      field: "gl_code",
                      title: "GL CODE",
                      editor: glCodeMaskedTextEditor
                  }
              ]


and

function glCodeMaskedTextEditor(container, options) {
    $('<input class="gl-code-edit" data-text-field="gl_code"
               data-value-field="gl_code_id" data-bind="value:'
+ options.field + '"/>')
        .appendTo(container)
        .kendoMaskedTextBox({
        mask: "99999999999999999999",
        promptChar: " "
    });
}

Any way to do this?  Thanks!  :)
Dimo
Telerik team
 answered on 12 Jun 2014
3 answers
192 views
Hi,

we've been using the MVC wrapper for Kendo UI Menu widget.

Otherwise it's working fine, but when testing with iPad, the dropdown menu won't show up if the parent menu item is a link. When clicking the parent item, instead of showing the dropdown, it simply opens the link and effectively refreshes the page.

I tried removing the link, and then the dropdown shows up without problems.

The link is created with the .Action() call on the helper. Should the Menu widget support dropdowns on touch screens in this scenario?
Kamen Bundev
Telerik team
 answered on 12 Jun 2014
1 answer
93 views
I have several views in my Kendo Mobile app and I use buttons and navigate function to navigate between the views.
Each view contains several input elements.

How do i select the first input element to be focused after the view is navigated to?

I have tried the follownig, but it does not focus on the input after the view is navigated to.

application.navigate('#loan-promotion-length');
$('#field-promotion-length').focus();
Alex
Top achievements
Rank 1
 answered on 11 Jun 2014
1 answer
206 views
Hello,  I am trying to figure out how to create an aggregate row on a grid when you group by any column.  I have created a demo of this using the regular kendo javascript. 

http://jsfiddle.net/UHzcw/44/

However, our solution uses the mvc helpers so I'll need to be able to use that but I can't figure out how to do it.  Here is our current code that we will be adding this to.  What are we missing here?  How do you add the aggregates to each column in mvc like in the javascript version?

 @(Html.Kendo().Grid<ReportListViewModel>()
                            .Name("ReportList")
                            .HtmlAttributes(new { @class = "cursorLink" })
                            .DataSource(ds => ds.Ajax()
                                .Aggregates( a => {
                                    a.Add(p => p.ReportName).Count();
                                    a.Add(p => p.ReportCategoryName).Count();
                                    a.Add(p => p.User_CreatedBy).Count();
                                    a.Add(p => p.CreatedDate).Count();
                                    a.Add(p => p.ReportDescription).Count();
                                })
                                .Read("ReportListData", "Reports", new { ProductName = ViewBag.SelectedProduct.ProductName })
                                .PageSize(500))
                                
                            .ToolBar(toolbar =>
                                {
                                    toolbar.Template(@<text>
                                       <div class="toolbar">
                                       <span class="">
                                           <a class="btn btn-small printGridButton"><i class="icon-print"></i>Print</a>
                                           <a class="btn btn-small saveGridButton" id="SaveReportList" data-mcpagename="ReportList" data-mcuserconfigsettingid="@reportListGridUserConfigId" data-mcuserconfigsettingname="ReportList" data-mcuserconfigshowpagemessage="true"><i class="icon-hdd"></i>Save View</a>
                                           <a class="btn btn-small resetGridButton" data-mcuserconfigsettingname="ReportList" data-mcuserconfigshowpagemessage="false"><i class="icon-repeat"></i>Reset View</a>
                                       </span>
                                       </div>
                                    </text>);
                                })
                            .Columns(c =>
                            {
                                c.Bound(f => f.ReportName).Title("Report Name").ClientTemplate("<input type='hidden' id='GridRowURL' value='" + Url.Action("ReportView") + "/#=ReportId#' />#:data.ReportName#").Width(300).ClientFooterTemplate("#=count#");
                                c.Bound(f => f.ReportCategoryName).Title("Category").Width(125).ClientFooterTemplate("#=count#");
                                c.Bound(f => f.User_CreatedBy).Title("Created By").Width(150).ClientFooterTemplate("#=count#");
                                c.Bound(f => f.CreatedDate).Title("Date Created").Width(120).Format("{0:d}").HtmlAttributes(new { @class = "kendoGridDate" }).ClientFooterTemplate("#=count#");
                                c.Bound(f => f.ReportDescription).Title("Description").ClientFooterTemplate("#=count#");
                                //c.Template(f => { }).ClientTemplate("#if (data.ReportSubscriptionId > 0) {# <a class='btn btn-mini' href='javascript:void(0)' onclick='updateReportSubscription(#=ReportSubscriptionId#, \"#=ReportId#\")'><i class=\"icon-pencil\"></i>Edit</a> #} else {# <a class='btn btn-mini' href='javascript:void(0)' onclick='addReportSubscription(\"#=ReportId#\")'><i class=\"icon-plus\"></i>Add</a> #}#").Title("Subscribe").HtmlAttributes(new { @class = "mc_reportSubscriptionCell" }).Width(90);
                            })
                            .Sortable(s => s.SortMode(GridSortMode.MultipleColumn))
                            .Groupable(g =>
                            {
                                g.Messages(m =>
                                {
                                    m.Empty("Drag Column Header Here to Group");
                                }
                                );
                            }
                            )
                            .Pageable(p =>
                            {
                                p.Input(true).Numeric(false);
                                p.PageSizes(new int[] { 250, 500, 1000, 2500, 5000 });
                            })
                            .Filterable(filterable =>
                                filterable.Operators(operators => operators
                                    .ForString(str => str.Clear()
                                        .Contains("Contains")
                                        .DoesNotContain("Does not contain")
                                        .IsEqualTo("Is equal to")
                                        .IsNotEqualTo("Is not equal to")
                                        .StartsWith("Starts with")
                                        .EndsWith("Ends with ")                                
                                    )
                                )
                            )
                            .AutoBind(false)
                            .ColumnMenu()
                            .Events(e => e.DataBound("OnDataBoundReportList"))
                            .Scrollable(builder => builder.Enabled(true).Height("500px"))
                            .Reorderable(r => r.Columns(true))
                        )
Daniel
Telerik team
 answered on 11 Jun 2014
1 answer
812 views
HI,

The Required field validation some times showing below the fields and for some fields beside the text box properly.Please find the attachment.
 
I have two fields State and Zip fields configured as below. Inspected items of the both the fields looks as below.
//State ComboBox
<td>
<span class="k-widget k-combobox k-header" style="width: 180px;">
<span class="k-dropdown-wrap k-state-default" unselectable="on" tabindex="-1">
<input class="k-input" type="text" autocomplete="off" name="State_input" style="width: 100%;" role="combobox" aria-expanded="false" placeholder="Select..." tabindex="0" aria-disabled="false" aria-readonly="false" aria-autocomplete="list" aria-owns="State_listbox" aria-busy="false" aria-activedescendant="State_option_selected">
<span class="k-select" unselectable="on" tabindex="-1">
<span class="k-icon k-i-arrow-s" unselectable="on" role="button" tabindex="-1" aria-controls="State_listbox">select</span>
</span>
</span>
<input id="State" class="k-invalid" style="width: 180px; display: none;" validationmessage="This is a required field." required="required" data-value-primitive="true" data-bind="value:State.Code" name="State" data-role="combobox" aria-disabled="false" aria-readonly="false" aria-invalid="true">
<div class="k-widget k-tooltip k-tooltip-validation k-invalid-msg" style="margin: 0.5em;" data-for="State" role="alert">
<span class="k-icon k-warning"> </span>
This is a required field.
<div class="k-callout k-callout-n"></div>
</div>
</span>
</td>
 
//ZIp text Box
<td>
<input id="Zip" class="k-input k-textbox k-invalid" type="Zip" style="width:180px;" validationmessage="This is a required field." required="required" maxlength="10" data-bind="value:Zip" name="Zip" aria-invalid="true">
<div class="k-widget k-tooltip k-tooltip-validation k-invalid-msg" style="margin: 0.5em;" data-for="Zip" role="alert">
<span class="k-icon k-warning"> </span>
This is a required field.
<div class="k-callout k-callout-n"></div>
</div>
</td>

This is how I have configured both the fields on popup Template

 <tr>
  <td>
<
input type="text" id="City" class="k-input k-textbox" name="City" data-bind="value:City"  maxlength="30" required="required" validationMessage="This is a required field." style="width:180px;"/>    
  </td>
</tr>                           
 <tr>
      <td>
<input id="State" name="State"  data-bind="value:State.Code"  data-value-primitive="true"  required="required" validationMessage="This is a required field." style="width: 180px;" />
  </td>
</tr>
 <tr>
    <td>
<input type="Zip" id="Zip" class="k-input k-textbox" name="Zip" data-bind="value:Zip" maxlength="10" required="required" validationMessage="This is a required field." style="width:180px;" />
<span data-for="Zip" class="k-invalid-msg"></span>
 </td>
</tr>

Styles we have for server validation messages.
.k-tooltip-validation.k-invalid-msg
{
    display:inline-block;   
}
  
.k-invalid-msg .k-callout
{
       display:none;
}

State Combobox
$("#State").kendoComboBox({
          placeholder: "Select...",
          dataTextField: "Code",
          dataValueField: "Code",
          headerTemplate: '<div class="dropdown-header">' +
                               '<span class="k-widget k-header">Code</span>' +
                               '<span class="k-widget k-header">Name</span>' +
                           '</div>',
          valueTemplate: '<span>#:data.Code#</span>',
          template: '<span class="k-state-default">#:data.Code#</span>' +
                                 '<span class="k-state-default">#:data.Name#</span>',
          dataSource: {
              transport: {
                  read: {
                      url: crudServiceBaseUrl + "/GetStates"
                  }
              }
          },
          filter:"startswith"
      });

Kiril Nikolov
Telerik team
 answered on 11 Jun 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
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?