Telerik Forums
Kendo UI for jQuery Forum
2 answers
640 views

I'm looking to add custom rules to a masked textbox and there is not enough documentation or examples to explain how this works properly.

 

$(this).kendoMaskedTextBox({

    mask: "mm/dd",

rules: {

mm: "any number between 01 - 12",

dd: "any number between 01 - 31"}})

 

I attempted to use a masked date picker, but it still allows for entries like "48/99" which is incorrect.

 

Is it possible to do something like this using custom rules and regex?

 

Nikolay
Telerik team
 answered on 19 May 2020
10 answers
252 views
I have kendo grid  and have paging options which is working as expected and issue is when i click on Page 2 some again page 2 is showing . Is there any possiblity to hide that . Please refer to attachment it should be very clear. 
Tsvetomir
Telerik team
 answered on 19 May 2020
6 answers
635 views
I have this datasource
var HDS = new kendo.data.HierarchicalDataSource({
    error: raiseAjaxErrorWindow,
    transport: {
        read: {
            url: HDS_URL,
            dataType: "jsonp"
        }
    },
    schema: {
        model: {
            id: "id",
            hasChildren: "hasChildren",
            data: "data"
        }
    }
});
and this tree view config
    $("#treeview").kendoTreeView({
        dataSource: HDS,
        dataTextField: "text",
        dragAndDrop: false,
        select: onSelect,
        expand: onExpand,
        collapse: onCollapse
    });

The HDS url delivers a callback that looks like

jQuery18209300398211926222_1361181052330(
[{"id":"2a1bfc85-06d5-4702-bc92-d659fcae9d39",
"text":"Group 1",
"hasChildren":"1",
"data":{"type":"1","depth":2,"color":"red","flavor":"up"}
}])


call this the foobar node.

How do I add extra rendering to the tree node to display the items in the data field?

When a node having children is opened, the HDS url is automatically ajaxed with data id=<id of node>.

Is there a way to configure the transport.read so that when it is to be opened, it will use some or all of the the extra data of the foobar node when ajaxing the url. ?

For instance, I would like the HDS to be called with the additional data  depth=2&type=1

If so, where would I put this little magic ?

Thanks,
Richard
Veselin Tsvetanov
Telerik team
 answered on 19 May 2020
12 answers
682 views
I would like to draw a line parallel to the X axis on a scatter chart at the average of the Y values.  I see plot bands listed for other types of charts, but nothing for scatter charts.  For run, I tried adding a plotBands config to the yAxis element of my scatterline chart, but nothing shows up.

Is there a plot line feature available for scatter charts?

I didn't see anything in the documentation:
http://demos.telerik.com/kendo-ui/scatter-charts/index
Srinivas
Top achievements
Rank 1
 answered on 19 May 2020
7 answers
1.2K+ views
Hello,

I have the value axis labels shown in the "current" screenshot.  I'm hoping to format them as shown in the "desired" screenshot, ie. displaying "25000" as "$25k".  I am able to add the "$" and "k" using valueAxis.labels.format.  But I'm unable to perform math on the value itself or remove the last two zeros.

Any help is greatly appreciated.

Thanks!
Vessy
Telerik team
 answered on 19 May 2020
1 answer
207 views

I'm very excited to see the birth of this new component. Does the component support drag & drop. My use case would be to have a tilelayout dashboard area to which I would like to drag & drop new items from a side toolbar.

Looking at the reference, it doesn't seem that this component currently support dynamic changes (add/remove) at all. Is that right? And if so, is it on the roadmap?

Best regards,
Ron

Viktor Tachev
Telerik team
 answered on 19 May 2020
2 answers
2.0K+ views

I have the following code to present a confirmation to the user but I am not sure how to close it ..

 kendo.confirm("Are you sure that you want to Update the System Cache? (<strong>Recommended<strong>)  </br></br> If Yes do not navigate away from this page")
            .then(function () {
                $('body').addClass('waiting');
                $('html,body').css('cursor', 'wait');
                $('btnUpdateCache').addClass('disabled');
                kendoConsole.log("Updating cache data please wait");
                kendoConsole.log("Do not navigate away from this page");
                $('#console-log').show();
             CLOSE IT HERE  <<<<<
            updateSystemCache();
        }, function () {
            //kendo.alert("You chose to Cancel action.");
        });

 

Given that code how would I close it?

Eyup
Telerik team
 answered on 19 May 2020
3 answers
81 views

Hi,

I implemented datasource filtering on my gantt (for jquery) widget which includes filtering of elements by start and end date. In terms of filtering logic, everything works fine, but this introduced interesting behaviour with my gantt. After any action (update of tasks via drag-n-drop for example), gantt is focused to the beginning of filter interval. 

I did some debugging and I came to piece of code in kendo library (displayed below) which seems to be cause of the problem.

Is there any way to prevent this focusing, because it doesn't make much sense to scroll there if i change task somewhere in the middle of range.

Thank you

_render: function (tasks) {
    var view = this.view();
    var range = this._range(tasks);
    var date = view.options.date;
    this._tasks = tasks;
    view.range(range);
    view.renderLayout();
    view.render(tasks);
    if (date) {
        view._scrollToDate(date);
    }
Ianko
Telerik team
 answered on 19 May 2020
4 answers
12.8K+ views
I'd like to set default values for a column when I add a new row to a grid.

How would I do that?

Thank you
Alex Hajigeorgieva
Telerik team
 answered on 18 May 2020
1 answer
723 views

I have create a kendo grid with batch editing using https://demos.telerik.com/kendo-ui/grid/editing for reference (using your demo service as suggested for my controller: https://github.com/telerik/kendo-ui-demos-service/blob/master/demos-and-odata-v3/KendoCRUDService/Controllers/ProductsController.cs).

The grid will read the data fine, but when I go to create the controller is unable to deserialize the "models" passed to it (as detailed in the parameterMaps function). After reading through various Telerik threads, I have tried ensuring editing mode is set to "incell" and ensuring batch mode is set to true. 

Do you know what I'm doing wrong that's stopping the data from binding?

 

Kendo grid

<div id="grid"></div>
 
  <script>
      $(document).ready(function () {
          var crudServiceBaseUrl = "/RegulationIndex",
              dataSource = new kendo.data.DataSource({
                  batch: true,
                  transport: {
                      read: {
                          url: crudServiceBaseUrl + "/GetRegulations",
                          dataType: "json",
                          type: "GET"
                      },
                      update: {
                          url: crudServiceBaseUrl + "/UpdateRegulations",
                          dataType: "json",
                          type: "PUT"
                      },
                      destroy: {
                          url: crudServiceBaseUrl + "/DeleteRegulations",
                          dataType: "json",
                          type: "DELETE"
                      },
                      create: {
                          url: crudServiceBaseUrl + "/AddRegulations",
                          dataType: "json",
                          type: "POST"
                      },
                      parameterMap: function (options, operation) {
                          if (operation !== "read" && options.models) {
                              return { models: kendo.stringify(options.models) };
                          }
                      }
                  },
                  pageSize: 20,
                  schema: {
                      model: {
                          id: "Id",
                          fields: {
                              Id: { editable: false },
                              LastReviewedDate: { editable: false },
                              LastReviewedBy: { editable: false }
                          }
                      }
                  }
              });
 
          $("#grid").kendoGrid({
              dataSource: dataSource,
              navigatable: true,
              pageable: true,
              height: 550,
              toolbar: ["create", "save", "cancel"],
              columns: [
                  { field: "Continent", width: 120 },
                  { field: "Area", width: 120 },
                  { field: "Country", width: 120 },
                  { field: "Service", width: 120 },
                  { field: "B2BOrB2C", title: "Customer Type", width: 120 },
                  { field: "RegulationName", title: "Regulation Name", width: 120 },
                  { field: "LastReviewedDate", format: "{0:dd/MM/yyyy}", width: 100 },
                  { field: "LastReviewedBy", width: 100 },
                  { command: "destroy", title: " ", width: 150 }],
              editable: "incell"
          });
      });
 
      function customBoolEditor(container, options) {
          $('<input class="k-checkbox" type="checkbox" name="Discontinued" data-type="boolean" data-bind="checked:Discontinued">').appendTo(container);
      }
  </script>

 

 

Controller action

        [HttpPost]
        [ProducesResponseType(StatusCodes.Status400BadRequest)]
        [ProducesResponseType(StatusCodes.Status404NotFound)]
        public async Task<IActionResult> AddRegulations()
        {
            var logMessage = new LogMessageFactory(this.GetType().Name, MethodBase.GetCurrentMethod().DeclaringType)
                .LogMessage;
            try
            {
                var body = JsonConvert.DeserializeObject<IEnumerable<RegulationViewModel>>("models");
                var gridRegulations = new List<RegulationViewModel>();
 
                if (body != null)
                {
                    if (!ModelState.IsValid)
                    {
                        return BadRequest(ModelState);
                    }
                    else
                    {
                        foreach (var reg in body)
                        {
                            RecordUserDateForRecordChange(reg);
                            var regulation = await _webApiClientSession.RegulationsWebApiClient.CreateRegulationAsync(reg);
                            var regulationViewModel = _mapper.Map<Regulation, RegulationViewModel>(regulation);
                            gridRegulations.Add(regulationViewModel);
                        }
                        _logger.LogDebug(logMessage);
                        return Json(gridRegulations);
                    }
                }
                else
                {
                    _logger.LogDebug(logMessage + "Failed to " + ControllerContext.HttpContext.Request.Method);
                    return BadRequest();
                }
            }
            catch (Exception e)
            {
                _logger.LogError(e, logMessage);
                return NotFound();
            }
        }
 

 

Nikolay
Telerik team
 answered on 18 May 2020
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
Accessibility
Effects
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
AICodingAssistant
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
+? 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?