Telerik Forums
Kendo UI for jQuery Forum
2 answers
1.5K+ views

Hi,

I have a histogram chart with very small values on the category axle, see attached image. I want the chart to display the values with 2 decimal places, but I can't find the correct way of doing this.

This is my code for the category axle:

categoryAxis: [{
    name: 'categoryAxis',                        
    categories: this.getEmptyCategories()
    ,
    labels: {                                                 
        visible: false                            
    },
    majorGridLines: {
        visible: true
    },
    justified:false
}],

How should I specify that I want more decimals?

Best regards,

Henrik

Henrik
Top achievements
Rank 1
 answered on 15 Aug 2018
3 answers
169 views
Hi Guys,

Have just tripped over an issue whereby calling the resize method on a grid with frozen columns causes rows within the frozen section to be out of alignment with those of the main grid.

To illustrate the problem run the following dojo

    https://dojo.telerik.com/IXiDOhAC

Scroll 'Order ID 10260' into view and then hit the Resize link and you should now see all the rows out of alignment.

Is this a known issue and if so are there any methods/workarounds to realign the rows after the resize?

Regards
Alan
Preslav
Telerik team
 answered on 15 Aug 2018
4 answers
249 views

Hi,

      I am working on contextMenu for grid. Currently, the grid has some data rows and the rest area is empty. ContextMenu on data rows works fine. However, I also need to right-click on the empty area of the grid, then I need to show a contextmenu(for example, "add new" function) and remove selection of the current grid data rows. How could I do it? Thanks for your help.

 

James

Tsvetina
Telerik team
 answered on 15 Aug 2018
3 answers
175 views

Hi,

I want to edit some functionality in Kendo grid. For instance Navigatable should behave different to its original implementation and AllowCopy should catch different key press and behave accordingly.

If possible can anyone provide samples to extend such functions. Note: Both function will take only boolean types.

 

Thanks in Advance,

Sam Azpan. D

 

Georgi
Telerik team
 answered on 15 Aug 2018
5 answers
801 views
I a binding the kendo treeview using the below set of code but it is showing only the parents not showing the childs:
public List<TreeViewItemModel> TreeItems
         {
             get
             {
                 lstTreeItems = new List<TreeViewItemModel>()
                {
                    new TreeViewItemModel()
                    {
                        Text = "Departments",                     
                        HasChildren=true,
                        Items = new List<TreeViewItemModel>
                        {
                            new TreeViewItemModel()
                            {
                                Text = "Sales",
                                ImageUrl="/Images/folder.png",
                                HasChildren=false
                            },
                            new TreeViewItemModel
                            {
                                 Text = "Marketing",
                                ImageUrl="/Images/folder.png",
                                HasChildren=false
                            },
                            new TreeViewItemModel
                            {
                                 Text = "Account",
                                ImageUrl="/Images/folder.png",
                                HasChildren=false
                            }
                        }
                         
                    },
                    new TreeViewItemModel
                    {
                        Text = "Users",
                        HasChildren=true,
                        Items = new List<TreeViewItemModel>
                        {
                            new TreeViewItemModel()
                            {
                                Text = "David"    ,
                                ImageUrl="/Images/folder.png",
                                HasChildren=false                           
                            },
                            new TreeViewItemModel
                            {
                                 Text = "Eric",
                                ImageUrl="/Images/folder.png",
                                HasChildren=false
                            },
                            new TreeViewItemModel
                            {
                                 Text = "Enrique",
                                ImageUrl="/Images/folder.png",
                                HasChildren=false
                            }
                        }
                    }
                };
                 return lstTreeItems;
             }
         }
 
        [OutputCache(NoStore=true,Duration=0)]
         public JsonResult GetFolderTreeData()
        {
 
            var test = TreeItems; 
 
            //var employees = new { Text = "Departments", ImageUrl = "/Images/folder.png", HasChildren = true };
 
 
            //return Json(employees, JsonRequestBehavior.AllowGet);
 
            DashboardViewModel model = new DashboardViewModel();
            return Json(test, JsonRequestBehavior.AllowGet);
        }
 
@(Html.Kendo().TreeView()
    .Name("treeview").DataTextField("Text").DataImageUrlField("ImageUrl")
    .DataSource(dataSource => dataSource
        .Read(read => read
            .Action("GetFolderTreeData", "Dashboard")
        )
    )
    .Events(events => events       
        .Select("onSelect")       
    )
     
)
Ivan Danchev
Telerik team
 answered on 15 Aug 2018
1 answer
434 views

I have an InCell editable (updating in BATCH) grid with several columns and 2 columns showing as dropdown lists.  the 2nd dropdown list is cascading from the first dropdown list.  I finally have the 2nd dropdown list working properly except that once I select the value and move to the next row in the grid, the selected value is disappearing.  I found an example from Telerik where this is working but for some reason, it's not working in my solution.  Here's my code:

 

ViewModel(s):

<p>public class ForeignKeyViewModel     {
        public IEnumerable<DefectGroupDropdownViewModel> DefectGroups { getset; }
        public IEnumerable<ScrapReasonDropdownViewModel> ScrapReasons { getset; }
    }</p><p></p><br><p>public class SingleScrapJobViewModel     {
        public string CoilId { getset; }
        [Display(Name="Activity Date")]
        [DisplayFormat(DataFormatString = "g")]
        public DateTime ActivityDate { getset; }
  
        [Display(Name = "Date Scrapped", Description = "Date coil was actually scrapped.")]
        [DisplayFormat(DataFormatString = "g")]
        public DateTime DateScrapped { getset; }
        public string LineTypeCode { getset; }
        public int LineTypeId { getset; }
         
        public int QuantityTypeId { getset; }
        [Required]
        public int TeamId { getset; }
        public decimal EntryWeight { getset; }
        public decimal EntryWidth { getset; }
  
        [UIHint("DefectGroupId")]
        [Required(ErrorMessage = "DefectGroupId is required")]
        public int DefectGroupId { getset; }
  
         
  
        [UIHint("ScrapReasonId")]
        [Required(ErrorMessage = "ScrapReasonId is required")]
        public int ScrapReasonId { getset; }
        public decimal AmountScrapped { getset; }
  
         
    }</p>

 

View:

@model ForeignKeyViewModel@{     ViewBag.Title = "Scrapped Coils";
     }<h2>Assign Scrap Reasons to Coils Scrapped on a Single Job</h2><br/><div class="container"><div class="row">         @(Html.Kendo().Grid<SingleScrapJobViewModel>()
              .Name("ScrappedCoilsGrid")
              .Columns(col =>               {
                  col.Bound(m => m.CoilId).Title("Coil Id");
                  col.Bound(m => m.LineTypeCode).Title("Process Code");
                  col.Bound(m => m.LineTypeId).Hidden(true);
                  col.Bound(m => m.EntryWeight).Title("Entry Weight");
                  col.Bound(m => m.AmountScrapped).Title("Amount Scrapped (Lbs)");
                  col.ForeignKey(k => k.DefectGroupId, Model.DefectGroups, "DefectGroupId", "DefectGroupName").Width(200).EditorTemplateName("DefectGroupId").Title("Category");
                  col.ForeignKey(k => k.ScrapReasonId, Model.ScrapReasons, "ScrapReasonId", "ScrapReasonName").Width(200).EditorTemplateName("ScrapReasonId").Title("Scrap Reason");
                   
              })
              .Editable(e=>e.Mode(GridEditMode.InCell))
  
              .ToolBar(toolbar =>               {
                  toolbar.Save();
              })
              .Sortable()
              .NoRecords("There are no records to show.")
              .Scrollable(scr => scr.Height(500))
              .DataSource(ds => ds
                  .Ajax()
                  .Batch(true)
                  .PageSize(30)
                  .Events(e => e.Change("onChange"))
                  .ServerOperation(true)
                  .Model(m =>                   {
                      m.Id(p => p.CoilId);
                      m.Field(f => f.CoilId).Editable(false);
                      m.Field(f => f.LineTypeCode).Editable(false);
                      //m.Field(f => f.DefectGroupId).DefaultValue(1);                       //m.Field(f => f.DefectGroup).DefaultValue(ViewData["DefaultDefectGroup"] as DropDownViewModel);                       //m.Field(f => f.ScrapReasonId);                       m.Field(f => f.EntryWeight).Editable(false);
                      //m.Field(f => f.AmountScrapped);                       m.Field(f => f.ActivityDate).Editable(false);
  
                      //m.Field(f => f.ScrapReason).DefaultValue(ViewData["DefaultScrapReason"] as DropDownViewModel);                   })
  
                  .Update(u=>u.Action("SaveSingleJobScrappedCoils", "ScrapAssignment"))
  
              ))     </div></div>

 

DefectGroupId EditorTemplate:

@model int@(Html.Kendo().DropDownListFor(m => m)
      .AutoBind(false)
      .OptionLabel("Select Category...")
      .DataTextField("DefectGroupName")
      .DataValueField("DefectGroupId")
      .DataSource(dataSource =>       {
          dataSource.Read(read => read.Action("GetDefectGroupsDropdownViewModelForGrid", "ScrapAssignment"))
              .ServerFiltering(true);
      })
      )@Html.ValidationMessageFor(m => m)

 

 

ScrapReasonId EditorTemplate:

@model int@(Html.Kendo().DropDownListFor(m => m)
      .AutoBind(false)
      .OptionLabel("Select Scrap Reason...")
      .DataTextField("ScrapReasonName")
      .DataValueField("ScrapReasonId")
      .DataSource(dataSource =>       {
          dataSource.Read(read => read.Action("GetScrapReasonsDropdownViewModelForGrid", "ScrapAssignment").Data("filterScrapReasons"))
              .ServerFiltering(true);
      })
      .CascadeFrom("DefectGroupId")
      )@Html.ValidationMessageFor(m => m)

 

 

Javascript in View:

function onChange(e) {
        if (e.action == "itemchange") {
            if (e.field == "DefectGroupId") {
                debugger;
                var model = e.items[0];
                model.set("ScrapReasonId", 0);
            }
  
        }
    }
  
    function filterScrapReasons() {
        var model = getCurrentEditedModel();
        return { defectGroupId: model.DefectGroupId };
    }
  
    function getCurrentEditedModel() {
        var grid = $("#ScrappedCoilsGrid").data("kendoGrid");
        var editRow = grid.tbody.find("tr:has(.k-edit-cell)");
        var selectedItem = grid.dataItem(editRow);
        debugger;
        return grid.dataItem(editRow);
    }

 

 

Been working on this for several days trying to get it to work.  Any ideas on how to get that 2nd dropdownlist to behave properly?

Jason
Top achievements
Rank 1
 answered on 14 Aug 2018
2 answers
313 views

Hi,

My question is not specific to jQuery but to Kendo UI Barcode and PDF Export in general. 

If I have an HTML page that contains some text and a Kendo UI Barcode (svg), will PDF Export correctly render the barcode?

Also, if I were to generate an HTML page with text, barcode, tables, etc... kind of like a big long report or reciept, will PDF Export automatically resize the content and add page breaks for me? For example, if you try to print this page using Acrobat it automatically adjusts the HTML to fit the paper size and automatically adds page breaks.

Thanks

Joe
Top achievements
Rank 2
 answered on 14 Aug 2018
3 answers
156 views
I am trying to implement some crud operations in a mobile listview. I came across this code library: http://www.kendoui.com/code-library/mobile/listview/listview---mvvm-crud-operations.aspx

The problem I'm running into is I am using endless scroll in my listview, so the item that is clicked on to be edited is not always in the datasource of the listview. Are there any examples of CRUD operations with endless scroll enabled on the listview?
Tsvetina
Telerik team
 answered on 14 Aug 2018
2 answers
578 views

Hello, 

I'm trying to get the dataTextField & dataValueField from double clicking on the ListBox. 

I feel like this should be easy but i cant find anything in the documentation or on google. 

 

So far i have this:

 

Preslav
Telerik team
 answered on 14 Aug 2018
6 answers
503 views
The Grid has a very nice incell edit mode, where the cell becomes editable after clicking on it (demo). How can that be used in a TreeList?
Alex Hajigeorgieva
Telerik team
 answered on 14 Aug 2018
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?