Telerik Forums
Kendo UI for jQuery Forum
1 answer
90 views
I have a  json data {(sample1:3,5,6)},{sample2:4,7,8}},that means column A,B,C. I   can easily draw that in  this sameple like this:
.Series(series => {
series.Column(new double[] { 3 ,4}).Name("column A");
series.Column(new double[] { 5 ,7}).Name("column B");
series.Column(new double[] {6,8}).Name("column C");

})
.CategoryAxis(axis => axis
.Categories("Sample1", "Sample2")
.Line(line => line.Visible(false))
.Labels(labels => labels.Padding(145,0,0,0))
),How to  write them in js code?
Hristo Germanov
Telerik team
 answered on 21 Aug 2013
4 answers
327 views
I have a kendoui grid setup and doing inCell edits. I have a button at the top to 'Add a new item'.  If I edit a couple of items they little red corners appear so I know they are dirty. If I then click the 'Add new item' button at the top of the grid, it removes the red flags from the edited items.  This is misleading and causes the user to think the only record that is dirty is the record they inserted to the grid. 


To reproduce:
Run the page attached.
Edit an item or 2 in the grid, but don't save.
They have little red flags in corners to show they are dirty.
Click Add new record button at top of grid.
The red flags disappeared from the dirty items.

How do I fix this?


I'm attaching files for the view and controller (using ASP.net MVC4).

Thank you in advance
Vladimir Iliev
Telerik team
 answered on 21 Aug 2013
5 answers
176 views
Hi

I'm using the image browser for the kendo ui web editor. It works fine but it pops up so far down the screen that you have to scroll to see the buttons. Screenshots are attached.

I'm guessing the cause is that the window is centered before it has the full height.

Best regards,
Martin
Northstar
Top achievements
Rank 1
 answered on 20 Aug 2013
1 answer
422 views

I have a Kendo grid that has a requirement for using a conditional dropdown in combination with batch editing. 

For instance I need to allow an order enterer set the color of a product from a dropdown, but each product has a potentially different set of available colors.

I have done something similar with InLine editing without a problem and the ajax call to populate the dropdown is getting called correctly in batch mode.  The problem appears to be that the #=productId# is not getting correctly parsed by Kendo.

View:

@( Html.Kendo().Grid<Web.Models.StudentGradeView>()
    .Name("Students")
    .Columns(columns =>
        {
            columns.Bound(c => c.Id);
            columns.Bound(c => c.Price);
            columns.Bound(c => c.Color);        })
        .ToolBar(toolbar =>
        {
            toolbar.Template( @"
                <span class=""pull-left"">
                        <a class=""btn k-grid-save-changes"" href=""javascript:void(0)""><span class=""k-icon k-update""></span> Save</a>
                        <a class=""btn k-grid-cancel-changes"" href=""javascript:void(0)""><span class=""k-icon k-cancel""></span> Cancel</a>
                </span>"
        })
        .Events(e => e.Edit("onEdit"))        .Editable(editable => editable.Mode(GridEditMode.InCell))
        .Sortable()
        .DataSource(dataSource => dataSource
            .Ajax()
            .Batch(true)
            .Events(events =>
                {
                    events.Error("error_handler");
                })
            .Model(model =>
                {
                    model.Id(m => m.Id);
                })
            .Read(read => read.Action("Product_Read", "Home", new { id = orderId }))
            .Update(update => update.Action("Product_Update", "Home"))
        )
    )

EditorTemplate

@model string

@(
 Html.Kendo().DropDownListFor(m => m)
    .OptionLabel("Select Color")
    .DataTextField("Color")
    .DataValueField("Color")
    .DataSource(dataSource =>
    {
        dataSource.Read("ColorsDropDown_Read", "DropDowns", new { Area = "", id = "#=ProductId#" });
    })
)


Controller

        public ActionResult ColorsDropDown_Read([DataSourceRequest] DataSourceRequest request, string id)
        {
            List<Grade> rVal = new List<Color>();
            rVal = _SystemSettings.AllColors.Where(w => w.ProductId == id)..ToList();         
            return Json(rVal, JsonRequestBehavior.AllowGet);
        }

Thanks!

 

Logan
Top achievements
Rank 1
Veteran
 answered on 20 Aug 2013
1 answer
92 views
Hi,
is there somewhere an example of the ServerSide part of the Imagebrowser using NodeJS(ExpressJS) ?

~Marc
Petur Subev
Telerik team
 answered on 20 Aug 2013
1 answer
324 views
my grid is like this:
.Name(MyGrid)
.Columns(columns =>
{
columns.Bound(p => p.ProductID);
columns.Bound(p => p.ProductName);
columns.Bound(p => p.UnitPrice);
columns.Bound(p => p.UnitsInStock);
})

I can style one row like :

dataBound: function () {
                    $("#MyGrid tbody tr:last").addClass("customClass");
                }
Alexander Valchev
Telerik team
 answered on 20 Aug 2013
3 answers
493 views
I have a Model which I bind to:
    @(Html.Kendo().Grid(Model.AccountSummary.ClientAccountSummaries)

I am trying to add all the Account Currencies for each Client into a each cell.

                                  columns.Bound(e => e.Client).Template(@<text>
                                                        @foreach (var account in item.Client.Accounts)
                                                        {
                                                            Html.Raw(account.Currency);
                                                            <br/>
                                                        }
                                                        
                                                    </text>)
                                            .Title("Type");

The code compiles and the objects are correct, but grid shows [object object] instead of "CDN<br>USD<br>EUR" in each cell. See image.

What am I missing here?


Alexander Popov
Telerik team
 answered on 20 Aug 2013
3 answers
314 views
Recently, the Telerik ASP.Net Ajax released their Q2 with a nice & powerful "Notification" control. This control can be very useful with 3 tier apps using pure Ajax to notify actions that take place on the server or web service. I suggest to consider this control for future development.

..Ben
Sebastian
Telerik team
 answered on 20 Aug 2013
5 answers
388 views
Hi, 

I have a grid working nicely with fairly simple rows and inLine editing enabled.  Everything is working  fine except for a couple of small issues.  Here they are:

  • I insert a row in the grid and fill it in.  Click save.  Row is committed as expected.
  • Without a refresh, I then click the edit button for the same row and attempt to make a change.  Save is clicked again.
  • The row acts as if it's still in "Create" mode and the data is sent to the the Create controller action.  As expected, that fails due to a primary key error of trying to insert the same row again.
  • I think this is incorrect.  It should be sent to the Update/Edit action.
  • Please advise...
Here is the grid code:

    @(Html.Kendo().Grid(Model.TimesheetDetails)
    .Name("TimesheetDetailGrid")
    .TableHtmlAttributes(new { style = "padding:0; margin:0;font-size:smaller;color:green" })
    .Columns(columns =>
    {
        columns.Bound(x => x.Id).Hidden();
        columns.Bound(x => x.TimesheetId).Hidden();
        columns.Bound(x => x.CompanyId).Hidden();
        columns.ForeignKey(p => p.JobCodeId, (System.Collections.IEnumerable)ViewData["JobCodes"], "Id", "JobCodeName")
                            .Title("Job Code")
                            .Width(150)
                            .HeaderHtmlAttributes(new { @class = "GridHeader" });
         
        columns.Bound(x => x.Description)
                            .Width(250)
                            .Title("Description")
                            .HeaderHtmlAttributes(new { @class = "GridHeader" });
         
        columns.Bound(x => x.WorkDate)
                            .Width(65)
                            .Title("Date")
                            .HeaderHtmlAttributes(new { @class = "GridHeader" });
 
        columns.Bound(x => x.StartTime)
                            .Width(55)
                            .Title("Start")
                            .Format("{0:hh:mm}")
                            .HeaderHtmlAttributes(new { @class = "GridHeader" })
                            .HtmlAttributes(new { @class = "StartTime" });
 
        columns.Bound(x => x.EndTime)
                            .Width(55)
                            .Title("End")
                            .Format("{0:hh:mm}")
                            .HeaderHtmlAttributes(new { @class = "GridHeader" })
                            .HtmlAttributes(new { @class = "EndTime" })
                            .ClientFooterTemplate("Hours: ");
 
        columns.Bound(x => x.Duration)
                            .Width(55)
                            .Title("Hours")
                            .HeaderHtmlAttributes(new { @class = "GridHeader" })
                            .ClientFooterTemplate("#=kendo.toString(sum, '0.00') #");
                             
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(122);
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable(x => x
        .PageSizes(true)
        .PageSizes(new int[] { 2, 3, 4, 5, 10, 25, 100 }))
    .Sortable()
    .Events(events => events.Edit("onEdit"))
    .Events(events => events.Save("onSave"))
    //.Events(events => events.DataBound("gridDataBound"))
    .DataSource(ds => ds
        .Ajax()
        .ServerOperation(true)
        .PageSize(10)
        .Model(m =>
        {
            m.Id(vm => vm.Id);
            m.Field(vm => vm.Id).DefaultValue(Guid.NewGuid()).Editable(false);
            m.Field(vm => vm.TimesheetId).DefaultValue(Model.Id).Editable(false);
            m.Field(vm => vm.CompanyId).DefaultValue(Model.CompanyId).Editable(false);
            m.Field(vm => vm.JobCodeId).DefaultValue(Guid.Empty);
            m.Field(vm => vm.Duration);
             
        })
        .Aggregates(aggregates =>
        {
            aggregates.Add(p => p.Duration).Sum();
        })
        .Read(read => read.Action("TimesheetDetail_Json", "Timesheet", new { Id = Model.Id }))
        .Create(update => update.Action("AddDetailRow_Json", "Timesheet"))
        .Update(update => update.Action("EditDetailRow_Json", "Timesheet"))
        .Destroy(update => update.Action("DeleteDetailRow_Json", "Timesheet"))
    )
)



My other issue is that I cannot get the aggregations to refresh upon editing or inserting a row.  I know that this happens when the datasource is refreshed and I've searched around for some more info.  I tried this as the save event handler for the grid.  No luck.  BTW, the same behavior with or without the e.model.set line.
function onSave(e) {
 
    var dataSource = this.dataSource;
    e.model.one("change", function () {
        dataSource.one("change", function () {
            //alert(dataSource.aggregates().Amount.sum);
        });
        dataSource.fetch();
    });
    e.model.set("Duration", $("#Duration").val());
 
}
I'd appreciate any help.




Vladimir Iliev
Telerik team
 answered on 20 Aug 2013
2 answers
326 views
By default, the tooltip can be shown on hover or always on per the documentation.

If using dataviz with mobile, you don't have hover abilities.  Clicking the point to show the tooltip would be optimal.  Is there anyway to do this?
Bill
Top achievements
Rank 1
 answered on 20 Aug 2013
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
Drag and Drop
Map
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
Licensing
ScrollView
Switch
TextArea
BulletChart
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
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
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
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?