Telerik Forums
UI for ASP.NET MVC Forum
3 answers
163 views
Hi,

I am trying fetch children nodes for destination node in drop event. Everything works ok, when read transport is configured as an object. But when I configure it as a function, it just reads root level nodes instead of children (there is no parameter id in data).

My code looks like this:

01.drop: function(e) {
02.    var _tree = this,
03.        _src = _tree.dataItem(e.sourceNode),
04.        _dest = _tree.dataItem(e.destinationNode),
05.        _pos = e.dropPosition;
06.             
07.        if (_pos == "over") {
08.            if (_dest.hasChildren) {
09.                if (!_dest.loaded()) {
10.                    var _result = _dest.children.fetch();
11.                            
12.                }
13.            }
14.        }
15.}

And transport read function:

01.transport: {
02.    read: function(options) {
03.        $.ajax({
04.            url: '@Url.Action("Read", "TreeView")',
05.            type: 'GET',
06.            dataType: 'json',
07.            data: options.data
08.        }).success(function (result) {
09.            return options.success(result);
10.        }).error(function (result) {
11.            return options.error(result);
12.        });
13.    }
14.}


Thanks in advance!

Daniel
Telerik team
 answered on 24 Mar 2014
0 answers
271 views
I have a line chart in a MVC razer web app to which the user can add at runtime up to 5 categories. The chart also has 2 x axes, one that delineates time, the other that delineates dates. The tooltip has been appearing over the particular category line over which the mouse hovers. I want the crosshair functionality where a vertical line appears and one tooltip shows the values for all categories and cannot get it to work.

I assume it has something to do with the fact I have 2 x axes, dynamically add categories at runtime, or both. Further, a y axis is added for each category that is added to the chart, though I assume the stuff going on with the y axes is not contributing to the problem, but I'm not certain of that.

Below is the cshtml code for the chart. It differs from the original code only in regards to:
1) The addition of .CategoryAxis(axis => axis.Crosshair(c => c.Visible(true)))
2) The addition of .Shared(true) for the tooltip.

I have not included any of the javascript/jQuery code that executes when a user adds a category, and I realize to solve this problem seeing that code may be necessary. Will provide on request.

Attached is a screen shot of the chart after 5 categories have been added, showing how a tooltip appears only for the category over which the mouse hovers.

@(Html.Kendo().Chart<TagValue>()
      .Series(series => series.ScatterLine(s => s.Local_TimeStamp, s => s.Value))
      .Legend(false)
      .HtmlAttributes(new { @class = "multiPenChart" })
      .CategoryAxis(axis => axis.Crosshair(c => c.Visible(true)))
      .XAxis(x => x.Date()
                .BaseUnit(ChartAxisBaseUnit.Minutes)
                .Labels(labels => labels.Visible(false).Format("HH:mm")))
      .XAxis(x => x.Date()
                .BaseUnit(ChartAxisBaseUnit.Minutes)
                .Color("#DAA520")
                .Labels(labels => labels.Visible(false).Format("MM/dd")))
      .Tooltip(tooltip => tooltip
          .Visible(true)
          .Shared(true)
          .Template("<div class='ChartTooltip'>#= formatDate(value.x) # - #= value.y #</div>"))
      .Events(events => events.DataBound("onDataBound"))
      .Name("chart"))

Curtis
Top achievements
Rank 1
 asked on 21 Mar 2014
1 answer
91 views
I'm not sure how to do this but here is the scenario:

I have a page with a header bar that is fixed to the top of the viewport and has a high z-index so that when the page is scrolled vertically, any page content scrolls under the page header bar.

When a window is displayed and centered - there is the chance that the window caption/titlebar appear underneath the header bar where it is now no longer possible to drag the window or close it via the "x" button.

What I am trying to achieve is to set a min-top position for the window where no matter if the window is centered or dragged it will never go less than 100 pixels from the top of the client area (not to be confused with the viewport).

Similar to windows dev where you subclass a window and handle the WM_WINDOWMOVE type message and adjust the window position after the fact.

Any idea?
Rene
Top achievements
Rank 1
 answered on 21 Mar 2014
1 answer
234 views
I have a nullable DateTime in a model and is set to required:

[Display(Name = "Birth Date")]
[Required()]
public DateTime? BirthDate { get; set; }


And in a partial view I have:

<div class="tableRow">
  <span class="tableCellLabelIndent">
    @Html.LabelFor(m => m.BirthDate)
  </span>
  <span class="tableCellInputWide">
    @Html.EditorFor(m => m.BirthDate, "Date")
    @Html.ValidationMessageFor(m => m.BirthDate)
  </span>
</div>

When the date is left blank, I get the validation error message, but I don't get the red outline styling that is typical with validation errors. A regular text box with the "k-textbox" styling works OK.

Daniel
Telerik team
 answered on 21 Mar 2014
1 answer
519 views
I'm using the editor and its in a jquery ui dialog, and I can't type text into the editor.

I call this function to open the jquery ui dialog:
function openSendEmailWindow(checkedArray) {
debugger;
$.ajax({
cache: false,
url: '/SendEmail/Email',
data: { checkedRecords: checkedArray.toString() },
type: "GET",
success: function (response, status, jqXHR) {
//debugger;
if (jqXHR.responseText) {
//debugger;
$("<div id='sendEmailWindow' style='display:none' title='Send Email'></div>").appendTo(".body-content");
$("#sendEmailWindow").html(response);
$("#sendEmailWindow").dialog({
position: ['top', 60],
width: 1300,
height: 625,
modal: true,

 close: function (event, ui) {
$(this).dialog('destroy').remove();
}
});
}
},
error: function (jqXHR) {
//debugger;
alert(jqXHR.statusText);
}
});
}

This is my partial view:
<div id="windowWrapper">
@using (Ajax.BeginForm("Email", "SendEmail", new AjaxOptions() { HttpMethod = "Post" }, new { id = "sendEmailForm", role = "form" }))
{
<div id="commandBar">
<span style="line-height:2em; margin-left:0.125em">
<button type="submit" class="k-button k-button-icon"><span class="k-icon k-update"></span></button>
<button type="button" onclick="closeSendEmailWindow(event);" class="k-button k-button-icon"><span class="k-icon k-cancel"></span></button>
</span>
</div>
<div id="windowContent">
<br />
@*@Html.AntiForgeryToken()*@
@Html.ValidationSummary(false, "Please correct the errors and try again:")
<div class="container-fluid">
<div class="row">
<div class='col-md-12'>
<div class="form-group">
@Html.LabelFor(m => m.Subject)<br />
@Html.TextBoxFor(m => m.Subject, new { @class = "form-control" })
@Html.ValidationMessage("Subject", "*")
</div>
</div>
</div>
<div class="row">
<div class='col-md-12'>
<div class="form-group">
@Html.LabelFor(m => m.Message)
@(Html.Kendo().EditorFor(m => m.Message)
.HtmlAttributes(new { @class = "form-control", style = "height:400px" })
)
@Html.ValidationMessage("Message", "*")
</div>
</div>
</div>
<div class="row">
<div class='col-md-12'>
<div class="form-group">
@Html.LabelFor(m => m.Attachment)<br />
@(Html.Kendo().Upload()
.Name("Files")
.HtmlAttributes(new { @class = "form-control" })
)
@Html.ValidationMessage("Attachment", "*")
</div>
</div>
</div>
</div>
@Html.HiddenFor(m => m.CheckedRecords)
@Html.HiddenFor(m => m.Attachment)
</div>
}
</div>

<script type="text/javascript">

function closeSendEmailWindow(e) {
this.parent.$("#sendEmailWindow").dialog('close');
}

$(document).ready(function () {

//for kendo numeric textbox to enable validation
$.validator.setDefaults({
ignore: ""
});

$.validator.unobtrusive.parse("#sendEmailForm");

$('#sendEmailForm').submit(function (e) {
debugger;
e.preventDefault();
$.ajax({
cache: false,
url: '@Url.Action("Email", "SendEmail")',
type: 'POST',
data: $(this).serialize(),
success: function (response, status, jqXHR) {
debugger;
if (jqXHR.responseText == '') {
$('input:checkbox').each(function () {
this.checked = false;
});
checked = {};
checkedArray = null;
 $("#sendEmailWindow").dialog('close');
}
},
error: function (jqXHR) {
debugger;
alert(jqXHR.statusText);
}
});
return false;
});

});

</script>


Daniel
Telerik team
 answered on 21 Mar 2014
2 answers
181 views
I have Telerik MVC grid in my view.

I'm binding the column "Debit Balance" value with calculation in my client side and data binding properly ,here is how i bind data

01.//my grid
02.    @( Html.Telerik().Grid<Orpac.Models.E_GetCarHar_Result>()
03.                     .Name("grdAccTransactions").NoRecordsTemplate("No record to display")
04.                     .Localizable("")
05. 
06.                     .HtmlAttributes("width: 100%;cellpadding:0;")
07.                     .Columns(columns =>
08.                     {
09.                         columns.Bound(e => e.CrhIdent).Hidden().IncludeInContextMenu(false);
10.                         columns.Bound(e => e.CrhTip).Hidden().IncludeInContextMenu(false);
11.                         columns.Bound(e => e.CrhTarih).Title((string)ViewData["Date"]);
12.                         columns.Bound(e => e.CrhTipNam).Title((string)ViewData["Description"]);
13.                         columns.Bound(e => e.CrhRef).Title((string)ViewData["Ref"]);
14.                         columns.Bound(e => e.CrhIslem).Hidden().IncludeInContextMenu(false);
15.                         columns.Bound(e => e.CrhDvzTut).Title((string)ViewData["Amount"]);
16.                         columns.Bound(e => e.CrhYrlTut).Title((string)ViewData["DebitBalance"]);
17.                         columns.Bound(e => e.CrhVade).Title((string)ViewData["DueDate"]);
18.                     })                
19.                     .DataBinding(d => d.Ajax().Select("GridAccountTransactionBinding", "Transaction"))
20.                     .ClientEvents(events => events.OnRowDataBound("onRowDataBoundAccTrans").OnLoad("onloadaccountTR").OnRowSelect("onRowSelectaccountTR"))
21.                     .Selectable()
22.                     .Sortable()
23.                     .Pageable(paging => paging.Enabled((bool)ViewData["paging"]).PageSize(10))
24.                     .Groupable(grouping => grouping.Enabled((bool)ViewData["grouping"]))
25.                     .Filterable(filtering => filtering.Enabled((bool)ViewData["filtering"]))
26.                     .Footer(((bool)ViewData["showFooter"]))
27.                     .Scrollable(scrolling => scrolling.Height(330))
28.                     .Resizable(config =>
29.                     {
30.                         config.Columns(true);
31.                     })
32.                     .Reorderable(config =>
33.                     {
34.                         config.Columns(true);
35.                     })
36.                    .ColumnContextMenu()
37.                   )
38.//this is how to bind grid
39. 
40.                    E_Get_Result p = new E_Get_Result();
41.                    p.CrhIdent = item.CrhIdent;
42.                    p.CrhTarih = item.CrhTarih;
43.                    p.CrhVade = item.CrhVade;
44.                    p.CrhRef = item.CrhRef;
45.                    p.CrhIslem = item.CrhIslem;
46.                    if (p.CrhIslem == "-")
47.                    {
48.                        p.CrhDvzTut = item.CrhDvzTut;
49.                        p.DebitBalance = Dbalance - item.CrhDvzTut;
50.                    }
51.                    else
52.                    {
53.                        p.CrhDvzTut = (-1)*item.CrhDvzTut;
54.                        p.DebitBalance  = Dbalance  + item.CrhDvzTut;
55.                    }

but when i group by with any dataMy row values binding without calculation? I can trace it with debugger values fetching true but grid doesn't show the same valueAfter Group by "Debit Balance" value shows uncalculating

Do you know this reason?Please help meThnx All
Haluk
Top achievements
Rank 1
 answered on 21 Mar 2014
4 answers
585 views
My application uses several Kendo UI controls.  Any one that I have tried in Chrome or Safari the verticle scroll bar is not visible. 
You are able to use the mouse scroll wheel and it will scroll up and down, but it should display the scroll bar. 

I saw a similar issue on another thread, but was no able to find it again.  And some one from Telerik responded claiming they could not reproduce this.  I was able to reproduce this on the http://demos.telerik.com/kendo-ui/web/grid/index.html site as the other thread described in both Chrome and Safari.  And no Chrome version was mentioned.  I have attached a working Firefox with scroll bar and a Chrome same page with out the scroll bar.

If there is a way to override this and resolve that would be most helpful.

Please see attached.


Pete
Pete
Top achievements
Rank 1
 answered on 20 Mar 2014
4 answers
318 views
Hi

I have a issue while trying save the grid state and loading it back if grouping is there "Uncaught TypeError: Cannot read property 'length' of undefined "

Steps to reproduce
1. Go to Products link in home page.
2. Group with any column in the grid (which will save the state to local storage).
3. refresh the page (this gives the error mentioned above in developer options console).

Please provide a suitable resolution for the same.

Note: I have attached the sample project (aspnetmvc-episode3.zip)

Regards
Anas
Daniel
Telerik team
 answered on 20 Mar 2014
1 answer
94 views
When hovering over a menu item in IE8, the styles to highlight that menu item don't seem to working.  I was able to reproduce this behavior here:

http://demos.telerik.com/kendo-ui/web/menu/index.html 

Any suggestions?

Dimo
Telerik team
 answered on 20 Mar 2014
1 answer
313 views
Hi,

I have used kendo mvc grid with ajax binding. One of the column of grid has small size thumbnails. when I hover on those thumbnails they should get expanded(zoom in zoom out) outside the cell so it does not affect row height.

i have used below javascript function and i am calling it  on onmouseover event of img tag inside clienttemplate, but it expands images inside cell. I want it outside the cell. Can you please let me know how i can achieve it without using lightbox or jquery hoverintent plugins
<script>
    function MyFunction()
    {
        $(document).ready()
        {
         $("#GridTable tbody tr td #wrap #Grid .k-grid-content table tbody tr td text img").hover(function() {
             kendo.fx(this).zoom("in").startValue(1).endValue(2).play();
         }, function() {
            kendo.fx(this).zoom("out").endValue(1).startValue(2).play();
        });
        }
    }
</script>



Vladimir Iliev
Telerik team
 answered on 20 Mar 2014
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
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?