Telerik Forums
Kendo UI for jQuery Forum
1 answer
547 views

I am trying to create a dynamic html table generator using ken-do Rad Spreadsheet. I am creating my custom toolbar that works fine but my question is, how can i remove Formula Bar, Column Header, Row Header and cells. I have attach a image to my question that is actually i am trying to achieve. can someone suggest me how can i do this am new to telerik.

working exampel: http://dojo.telerik.com/@veselints/iFUgiTOR

 

Thanks.

Nencho
Telerik team
 answered on 05 Oct 2018
3 answers
2.5K+ views
Hello ,
              When i bind my viewModel with selector div ,as shown below,
kendo.bind($("#SampleDivContainer"), viewModel);

  following error is shown and app is crashed :
    Uncaught TypeError: Cannot read property 'replace' of undefined

            Is it template error or viewModel error, is there some idenfication/error document which can help me to handle error like this in future?
Neli
Telerik team
 answered on 05 Oct 2018
1 answer
389 views

I've got a nested kendo grid in an mvc view that I can't get the create functionality to work right.  It's displaying all parent/child information correctly when the view loads, but when creating a new parent record,instead of a blank child grid, I get ALL items in that child list.  Not sure what I'm doing wrong - should have an empty child grid when expanding a new parent element that hasn't been saved yet - not to mention no children have been added to it.  I've also attached screenshots of the view showing exactly what's going on.

 

View Models:

public class DefectGroupViewModel 
    {
        public int DefectGroupId { getset; }
        public string Value { getset; }
  
        public IEnumerable<ScrapReasonViewModel> ScrapReasons { getset; }
    }

 

public class ScrapReasonViewModel 
    {
        public int ScrapReasonId { getset; }
        public string Value { getset; }
        public string ScrapCode { getset; }
        public int DefectGroupId { getset; }
    }

 

 

Partial View:

 

@model DefectGroupViewModel
 
@{ViewBag.Title = "Defect Groups"; }
 
<script src="~/Scripts/ErrorHelper.js"></script>
 
<script type="text/kendo" id="scrapReasonsTemplate">     
    @(Html.Kendo().Grid<
ScrapReasonViewModel>()
                  .Name("grid_#=DefectGroupId#")
                  .ToolBar(tb => tb.Create())
                  .Columns(column =>                   {
                      column.Bound(x => x.ScrapReasonId).Visible(false);
                      column.Bound(x => x.Value).Width(50).Title("Scrap Reason");
                      column.Bound(x => x.ScrapCode).Width(50).Title("Scrap Code");
                      column.Bound(x => x.DefectGroupId).Visible(false);
                      column.Command(command => { command.Edit(); }).Width(250);
                  })
           
                .DataSource(ds => ds
                      .Ajax()
                      .Model(model =>                       {
                          model.Id(e => e.ScrapReasonId);
                          model.Field(e => e.ScrapReasonId).Editable(false);
                          model.Field(e => e.DefectGroupId).Editable(false);
  
                      })
  
                      .Read(r => r.Action("ReadScrapReasons", "Admin", new { defectGroupId = "#=DefectGroupId#" }))
                      .Create(c => c.Action("CreateScrapReason", "Admin", new { defectGroupId = "#=DefectGroupId#" }))
                      .Update(u => u.Action("UpdateScrapReason", "Admin", new { defectGroupId = "#=DefectGroupId#" }))
                  )
  
                  .Sortable()
                  .ToClientTemplate()
    )</script>
 
<div
    @(Html.Kendo().Grid<DefectGroupViewModel>()
                  .Name("DefectGroupGrid")
                  .Columns(column =>                   {
                      column.Bound(c => c.DefectGroupId).Visible(false);
                      column.Bound(c => c.Value).Width(225).Title("Defect Group");
                      column.Command(command => { command.Edit(); }).Width(250);
                  })
                  .ToolBar(tb => tb.Create())
                  .Editable(editable => editable.Mode(GridEditMode.InLine))
                  .Pageable()
                  .Sortable()
                  .Scrollable(s => s.Height(375))
                  .DataSource(ds => ds
                      .Ajax()
                      .PageSize(30)
                      .ServerOperation(true)
                      .Events(events =>                       {
                          events.Error("error_handler");
                       })
                      .Model(model =>                       {
                          model.Id(e => e.DefectGroupId);
                          model.Field(e => e.DefectGroupId).Editable(false);
                          model.Field(e => e.ScrapReasons).DefaultValue(new List<ScrapReasonViewModel>());
                      })
                      .Read(r => r.Action("ReadDefectGroups", "Admin"))
                      .Create(c => c.Action("CreateDefectGroup", "Admin"))
                      .Update(u => u.Action("UpdateDefectGroup", "Admin"))
                  )
          .ClientDetailTemplateId("scrapReasonsTemplate")
          )
</div>
 
<script type="text/javascript">     
 
function error_handler(e) {
        if (e.errors) {
            var message = GetErrorMessage(e);
            new Noty({
                text: message,
                type: 'error',
                layout: 'topCenter',
                timeout: 4000             }).show();
        }
    }
  
  </script>
Tsvetina
Telerik team
 answered on 05 Oct 2018
7 answers
1.5K+ views
Simple in jQuery, but I haven't figured out to only allow one checkbox checked at a time (used to enable editing a specific user): I'm using the following simple jquery to enable/disable buttons:

                                    function onCheck(e) {
                                        
if ($('input.checkTreeview').is(':checked')) {
                                              $(
'#addUserButton').attr('disabled', 'disabled');
                                              $(
'#modifyUserButton').attr('disabled', false);
                                         }
else {
                                              $(
'#addUserButton').attr('disabled', false);
                                              $(
'#modifyUserButton').attr('disabled', 'disabled');
                                          }

                                    }


Anything I can do here to allow only one checkbox checked at a time?
Neli
Telerik team
 answered on 05 Oct 2018
1 answer
119 views
I want to just remove "Heading 1" from the paragraph dropdown, everything else is fine... but how on earth do I get rid of that?
Plamen
Telerik team
 answered on 05 Oct 2018
18 answers
731 views
In Firefox and Internet Explorer, when an image is added to an Editor window using the Image Browser, the user can resize the image using the handles presented when the user clicks on the image.

This functionality is not available in Chrome. Is there a reason? When can we expect this functionality to be implemented for Chrome?

Thank you.
Rumen
Telerik team
 answered on 05 Oct 2018
1 answer
293 views

hello:

We use checkmax for weak sweeps,

and there are some XSS Issues for Kendo Grid.

How can I solve it?

 

our codes:

public ActionResult GridSearch([DataSourceRequest] DataSourceRequest request)

{
  ....
  return Json(svc.GridSearch(request));

}

 

Georgi
Telerik team
 answered on 05 Oct 2018
3 answers
162 views
I have a grid of model with subset collection property like this:

    public partial class MenuGroup
    {
        public MenuGroup()
        {
            Item = new HashSet<Item>();
        }

        public int Id { get; set; }
        public string Label { get; set; }

        public virtual ICollection<Item> Item { get; set; }
    }

When the `Item` subsets are empty the grid displays without problems.

When the subsets have any items (eg. `Count > 0`) the grid breaks and does not display any records.

My grid:

            @(Html.Kendo().Grid<MenuGroup>().Name("menu")
                  .Columns(columns =>
                  {
                      columns.Bound(c => c.Label);
                      columns.Command(cmd => cmd.Edit());
                  })
                  .DataSource(dataSource => dataSource
                      .Ajax()
                      .Model(model => model.Id(m => m.Id))
                      .Read(read => read.Action("Read", "Menu"))
                  )
                  .ToolBar(x=>x.Create())

                  .Pageable()
                  .Sortable()
            )

I am using Entity Framework to populate the menu:

        public async Task<ActionResult> Read([DataSourceRequest]DataSourceRequest request)
        {
            var model = _menuRepository.GetMenuWithItems();

            return Json(model.ToDataSourceResult(request), new JsonSerializerSettings { ContractResolver = new DefaultContractResolver() });
        }

This is my repository:


        public IEnumerable<MenuGroup> GetMenuWithItems()
        {
            try
            {
                var model = _context.MenuGroup.Include(m => m.Item);
                //var model = _context.MenuGroup; // This set (without items) displays well)

                return _context.MenuGroup.Include(m => m.Item);
            }
            catch (Exception err)
            {
                throw new Exception("Error getting the menus: " + err);
            }
        }
Viktor Tachev
Telerik team
 answered on 05 Oct 2018
5 answers
626 views

Hi,

I have implemented the kendo ui diagram using the HierarchicalDataSource. On loading the diagram, connections between the shapes is not happening(child items).Simple code tried in the dojo https://dojo.telerik.com/OYupExUq.

<div id="diagram"></div>
<script>
  var dataSource = new kendo.data.HierarchicalDataSource({
    data: [{
      "id":"1",
      "name": "Progress",
      "items": [
        {"id":"2",
          "name": "Kendo UI",
         "items":[
           {"id":"3","name": "TreeList"},
           {"id":"4","name": "Chart"}
         ]
        },
        {"id":"5","name": "NativeScript"}
      ]
    }],
    schema: {
      model: {
        children: "items"
      }
    }
  });
  console.log(dataSource);
  $("#diagram").kendoDiagram({
    dataSource: dataSource,
    layout: {
      type: "tree",
      subtype: "down"
    },
    shapeDefaults: {
      type: "circle",
      content: {
        template: "#= name #"
      },
      width: 80,
      height: 80,
      hover: {
        fill: "Orange"
      }
    },
    connectionDefaults: {
      stroke: {
        color: "#979797",
        width: 1
      },
      type: "polyline",
      startCap: "FilledCircle",
      endCap: "ArrowEnd"
    }
    ,
    connections:[
      {
        from: "3",
        to: "5",
        content: {
            text: "Step 1"
        },
        stroke: {
            color: "#33ccff"
        }
      }
    ]
  });
</script>

 

Also posted in stack overflow and elaborate the issue.I have not come across any examples with connection datasouce using HierarchicalDataSource.
https://stackoverflow.com/questions/52500325/kendo-ui-diagram-hierarchicaldatasource-set-connection-datasource-issues.

From the attached image the requirement is to draw the connections between "TreeList" to "NativeScript".

Let me know if this is achievable.

Thanks

Dev

Tsvetina
Telerik team
 answered on 05 Oct 2018
13 answers
2.0K+ views

Hi Guys,

Kendo UI Professional 2017.1.330

I have just tripped over a little issue whereby the rows of  a frozen column get out of alignment with the rest of the grid.

The scenario is as follows :-

I have an angularjs page hosting a grid with a single frozen column which contains a couple of buttons for maintenance.
Clicking the buttons calls a UI Bootstrap Modal for the user to enter some data and to acknowledge the action.

Everything works fine when clicking on a button on a row which is fully in view.

However on clicking a button on a row which is only partially in view (See last row of Image1) the modal is opened as expected but when it is closed the frozen column is scrolled slightly to fetch the button fully into view but the other grid columns are not touched.

This results in the rows of frozen column being offset with the rest of the grid (See Image2).

I have tried playing around with the various methods of the grid (.current() .table.focus() etc) pre/post opening the modal, to try and force a re-alignment all to no avail.

Therefore I would be most grateful for any advice to try and overcome this issue.

Thanks
Alan

Hector
Top achievements
Rank 1
 answered on 04 Oct 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?