Telerik Forums
Kendo UI for jQuery Forum
2 answers
425 views

Is there a way to apply a regex to a range validation? Here's the gist of what I'm looking for:

var spreadsheet = $("#spreadsheet").kendoSpreadsheet({
  rows:10,
  columns: 1,
  toolbar: false,
  sheetsbar: false,
  sheets: [
    {
      rows: [
        {
          height: 30,
          cells: [
            { value: "Decive Password", background: "#001D42", color: "#fff" }
          ]
        }
      ],
      columns: [
        { width: 130 }
        ]
    }
  ]
}).data("kendoSpreadsheet");
 
var range = spreadsheet.activeSheet().range("1:1");
range.enable(false);
 
var columnSens = spreadsheet.activeSheet().range("A2:A10");
columnSens.validation({
  dataType: "custom",
  from: 'REGEX("^(()|((?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z]).{8,60}))$")',
  type: "warning",
  allowNulls: true,
  titleTemplate: "Invalid Password",
  messageTemplate: "Passwords must be between 8 - 60 characters long and contain the following: 1 number, 1 uppercase letter, 1 lowercase letter, and 1 special (non letter or number) character."
});

 

If this is not possible, is there any way to use javascript to validate the value with a regex in the onChange event and manually set the field to have an error if it doesn't match? (See the commented area of the code). 

Dojo: http://dojo.telerik.com/AHefE

  var regex = new RegExp("^(()|((?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[^\\da-zA-Z]).{8,60}))$");
  arg.range.forEachCell(function(row, col, cell){
    debugger;
    if(!regex.test(cell.value)){             
      //How to manually show an error in the cell?!?!?
      console.log("failed!");
    }
  });
}
 
var spreadsheet = $("#spreadsheet").kendoSpreadsheet({
  change: onChange,
  rows:10,
  columns: 1,
  toolbar: false,
  sheetsbar: false,
  sheets: [
    {
      rows: [
        {
          height: 30,
          cells: [
            { value: "Decive Password", background: "#001D42", color: "#fff" }
          ]
        }
      ],
      columns: [
        { width: 130 }
        ]
    }
  ]
}).data("kendoSpreadsheet");
 
var range = spreadsheet.activeSheet().range("1:1");
range.enable(false);

 

 

 

Ivan Danchev
Telerik team
 answered on 07 Apr 2017
1 answer
334 views

Hello,

Since Kendo ships with Web Font Icons, I would assume, that they work inside the Kendo Menu when using spriteCssClass on menu items.

Turns out, they are not working in the menu.

http://dojo.telerik.com/amUji

Am I doing something wrong? Fontawesome Icons work fine.

Best regards.

Ivan Zhekov
Telerik team
 answered on 07 Apr 2017
5 answers
149 views

Hi,

 

I have menu columns in my when we click menu columns, we can decide which columns to display in UI. But when I click menu columns to decide which columns to display in UI, my UI just sucks. Why ? How can I solve?

Stefan
Telerik team
 answered on 07 Apr 2017
3 answers
78 views

Is it possible to show the following when looking at the year view?

How custom can we make the header?  I would like to have the following rows

Year

Quarter

Month

Weekday start

Week # (of the year)

 

 

Derek
Top achievements
Rank 1
 answered on 06 Apr 2017
1 answer
146 views

Dear Sir/Madam,

    

   We are working to build a scheduler based web application and purchased the Kendo UI license to make use of the features that you have build in the control. 

   While working with our business owners team, we understand that there are some difficulties in achieving some of the below business requirements and we are seeking your help to the identify the approach. 

  1. We wanted to have the ability to scroll the calendar control,  when user prepares schedule for more than 6 weeks. 

  2. Please refer the attached UI wireframe, where in we have business requirements to display shift allocation for assignee and for a particular day.  (We normally have multiple shifts on any day of the scheduling period). Our business owners looking to increase the height of calendar day cell dynamically depending on number of shifts.

  3. A Grey line to differentiate the months (Highlighted in red box) 

  4. Display month name vertically on the left side of the calendar

  5. We have requirement to refresh / change shift allocation for a particular day (Day cell) independently in the calendar.  

  6. Calendar to be displayed for any time range (not just for a month) - Please see the blue highlight in the attached image. 

Requesting you provide the guidelines or approaches or examples  to implement these features.  

Please reply back, in case if you want to have quick discussion to clarify any questions you may have. 

 

Thanks & looking forward to hear from you. 

 

Regards,

 

 

 

 

  

  

 

Tyler
Top achievements
Rank 1
 answered on 06 Apr 2017
14 answers
1.6K+ views

Hi, 

 

I am using ASP.NET MVC for kendo grid. I want to Insert Dropdown menu to grid row. But I did not find any related articles.

 

I assume there will something I insert @(Html.Kendo().Menu() to @(Html.Kendo().grid()

 

 

Boyan Dimitrov
Telerik team
 answered on 06 Apr 2017
2 answers
1.1K+ views

Hey there guys, I've spent a good amount of time looking through other people's issues for this problem and haven't found it addressed yet.

Basically the problem I'm experiencing is trying to create an extension method to HtmlHelper (which works fine), but for some reason setting up corrected operators on filterable is causing issues. Here the code I am trying to use:

public static GridBuilder<T> ExtensionGrid<T>(this IHtmlHelper<dynamic> helper, string name)
            where T : class
        {
            return helper.Kendo().Grid<T>()
                .Name(name)
                .Filterable(filterable => filterable
                    .Extra(false)
                    .Operators(operators => operators
                        .ForString(str => str
                            .Clear()
                            .Contains("Contains")
                            .DoesNotContain("Does not contain")
                            .StartsWith("Starts with")
                            .EndsWith("Ends with")
                            .IsEqualTo("Is equal to")
                            .IsNotEqualTo("Is not equal to ")   // <== trailing space is intentional.
                        )
                    )
                )
                .Pageable(pager => pager
                    .ButtonCount(5)
                    .PageSizes(new int[] { 5, 10, 20, 50, 100, 150, 200 })
                    .Input(true)
                    .Refresh(true)
                )
                .Sortable(sortable => sortable
                    .Enabled(true)
                    .AllowUnsort(false)
                )
                .Events(events =>
                {
                    events.FilterMenuInit("trapKendoGridFilterEnterKey");
                });
        }

I can see the UI responding to the Extra(false) piece, but not to the ForString() piece (still just seeing the default string operators). I also see the same behavior when I apply it directly to a grid like this:

@(Html.Kendo().Grid<Role>()
            .Name("RoleGrid")
            .Columns(columns =>
            {
                columns.Bound(c => c.RoleId)
                    .Hidden(true);
                columns.Bound(c => c.RoleCode);
                columns.Bound(c => c.RoleName);
                columns.Bound(c => c.RoleDescription);
                columns.Bound(c => c.RoleDisplayOrder);
            })
            .Filterable(filterable => filterable
                .Extra(false)
                .Operators(operators => operators
                    .ForString(str => str
                        .Clear()
                        .Contains("Contains")
                        .DoesNotContain("Does not contain")
                        .StartsWith("Starts with")
                        .EndsWith("Ends with")
                        .IsEqualTo("Is equal to")
                        .IsNotEqualTo("Is not equal to ")
                    )
                )
            )
            .Scrollable()
            .Selectable()
            .Sortable()
            .Pageable(pageable => pageable
                .ButtonCount(5)
                .PageSizes(new int[] { 5, 10, 20, 50, 100, 150, 200 })
                .Input(true)
                .Refresh(true)
            )
            .DataSource(dataSource => dataSource
                .Ajax()
                .Model(model =>
                {
                    model.Id(m => m.RoleId);
                    model.Field(m => m.RoleId).Editable(false);
                })
                .Events(events => events
                    .Error("ajaxErrorHandlerForGrid('RoleGrid')")
                )
                .Read(read => read.Action("Role_Read", "Shared"))
            )
        )

 

The only time I do see it working is with a row level filter such as this:

@(Html.Kendo().Grid<Role>()
            .Name("RoleGrid")
            .Columns(columns =>
            {
                columns.Bound(c => c.RoleId)
                    .Hidden(true);
                columns.Bound(c => c.RoleCode)
                    .Filterable(f => f.Extra(false).Operators(o => o.ForString(str => str.Clear().Contains("Contains"))));
                columns.Bound(c => c.RoleName);
                columns.Bound(c => c.RoleDescription);
                columns.Bound(c => c.RoleDisplayOrder);
            })
            .Filterable(filterable => filterable
                .Extra(false)
                .Operators(operators => operators
                    .ForString(str => str
                        .Clear()
                        .Contains("Contains")
                        .DoesNotContain("Does not contain")
                        .StartsWith("Starts with")
                        .EndsWith("Ends with")
                        .IsEqualTo("Is equal to")
                        .IsNotEqualTo("Is not equal to ")
                    )
                )
            )
            .Scrollable()
            .Selectable()
            .Sortable()
            .Pageable(pageable => pageable
                .ButtonCount(5)
                .PageSizes(new int[] { 5, 10, 20, 50, 100, 150, 200 })
                .Input(true)
                .Refresh(true)
            )
            .DataSource(dataSource => dataSource
                .Ajax()
                .Model(model =>
                {
                    model.Id(m => m.RoleId);
                    model.Field(m => m.RoleId).Editable(false);
                })
                .Events(events => events
                    .Error("ajaxErrorHandlerForGrid('RoleGrid')")
                )
                .Read(read => read.Action("Role_Read", "Shared"))
            )
        )

 

I have tried setting the GridFilterMode to menu, but that didn't cause any change. And I'm using the latest release of Telerik.UI.for.AspNet.Core (2017.1.118), the project type is .NET Core with .NET Framework, and it is using similar code to a .NET Framework project that currently works fine. Is this functionality that is no longer supported or is there a new way to implement it that I am missing?

Thanks for the help.

Konstantin Dikov
Telerik team
 answered on 06 Apr 2017
3 answers
232 views

Hi folks,

I try to use the noDataTemplate as mentioned in example on "http://demos.telerik.com/kendo-ui/autocomplete/addnewitem" for adding new items if they not exist in data source. The data source in my case is a local one, NOT using remote data. My application is running with angular and I use the autocomplete inside an angular controller, NOT as angular directive. Inside the loaded template I try to use a scope function of my angular controller, to trigger the new item adding.

Now at run time, the template is inserted into the DOM at the end of the body not inside my controller area, where the autocomplete is located.

 

Now the problem is, that the scope function is not found in template. Is there any other approach or what is my mistake by initializing the autocomplete control?

 

Thx and 

kind regards

Danny

Dimitar
Telerik team
 answered on 06 Apr 2017
1 answer
527 views

OK I give in... how do you add items to a Sortable Dynamically?  

 

Also, is it possible to temporarily hide items?

 

And can a sortable be generated from an array/datasource?

Stefan
Telerik team
 answered on 06 Apr 2017
1 answer
250 views

I would like to remove the "Add" button on my kendo grid and instead have a permanently available add row at the bottom of the grid.  When the user clicks the update button in that grid it would fire the create command and add the row.

 

It looks like i can set the insert row to the bottom by using: 

.Editable(e => e.Mode(GridEditMode.InLine).CreateAt(GridInsertRowPosition.Bottom))

I then tried to make the add row visible by using the following code

.Events(e => e.DataBound("Adjustment_Bound"))

<script type="text/javascript">
    function Adjustment_Bound() {
        var grid = $("#Adjustment-grid").data("kendoGrid");
        grid.addRow();
    }
 
</script>

 

This however locked up the browser,  I am guessing because the addRow() causes the databound to get refired.

 

TIA,

Logan

Konstantin Dikov
Telerik team
 answered on 06 Apr 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
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
Iron
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
Iron
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?