Telerik Forums
Kendo UI for jQuery Forum
1 answer
133 views
I want to be able to detect when a dbl click on the scheduler is an edit of an existing event, or a new event.
I then want to use a different template or at least be able to alter the template accordingly.
Is tis possible, thanks?
Thanks
Rosen
Telerik team
 answered on 08 Jan 2015
1 answer
516 views
I have a Kendo Window on a page, using a partial. Currently when I submit the form, it completes and redirects me to the parent page and the window is gone. I am trying to keep the user in the window until the form is complete and they close the window. 

Window Code:
@(Html.Kendo().Window()
    .Name("fileUpload")
    .Title("Upload File Attachments")
    .Visible(false)
    .Iframe(true)
    .Content(@<text>@Html.Partial("_FileBrowser", (List<AttachmentViewModel>)ViewBag.AttachmentFileViewModel)</text>)
    .Modal(true)
    .HtmlAttributes(new { @style = "width:470px; height:160px;" }))

Partial:
@using Kendo.Mvc.UI
@model List<StationaryTools.ViewModels.AttachmentViewModel>
 
@using (Html.BeginForm("UploadThesefiles", "EquipmentWorkOrder", FormMethod.Post, new { id = "imageBrowser", name = "imageBrowser", target = "_self", enctype = "multipart/form-data" }))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
    // get the stationaryID here to store so it doesn't get lost
    @Html.HiddenFor(m => m[0].StationaryID)
    @Html.HiddenFor(m => m[0].SiteID)
    @Html.HiddenFor(m => m[0].EquipmentID)
 
    <div class="editor-field" id="dialogFileUpload">
        <table width="100%">
            <tr>
                <td class="valveEditSmallLabel"><strong>Attached Files</strong></td>
                <td></td>
                <td></td>
            </tr>
            @for (int i = 0; i < Model.Count; i++)
            {
                if (!Model[i].HasFile && ViewBag.CanEdit)
                {
                    <tr>
                        <td></td>
                        <td>
                            @Html.TextBoxFor(m => Model[i].File, new { type = "file", @style = "width:300px; margin-right: 4px;" })
                        </td>
                    </tr>
                }
                if (Model[i].HasFile)
                {
                    <tr>
                        <td></td>
                        <td>
                            @Html.ActionLink(Model[i].FileName, "GetThisFile", new { equipmentWorkOrderID = Model[i].StationaryID, stationaryFileName = Model[i].FileName }, new { target = "_blank", @style = "float: right; margin-right:4px;" })
                        </td>
                    </tr>
                }
            }
            <tr>
                <td></td>
                <td class="equipmentListSearchButtonRight">
                    <input type="submit" value=@Resources.Common_UploadFile id="btnSaveAttachments" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <span class="field-validation-error">*Attachments can be .jpg, .jpeg, .png or .pdf and must be 1MB or less in size.</span>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    @Html.ValidationMessageFor(m => m[0].File)
                <div>@MvcHtmlString.Create((string)TempData["FileUploadMessage"])</div>
            </td>
        </tr>
        </table>
    </div>
}

Controller Action:
[HttpPost]
public ActionResult UploadTheseFiles(List<AttachmentViewModel> attachmentFileModels)
{
    List<SalesToolsPOCOLibrary.GetThisStationaryFile_Result> getFile = siteManager.GetTheseStationaryFiles(attachmentFileModels[0].StationaryID, 0, Constants.FILETYPE_WORKORDER, 7);
    string existingFileName = "";
    //if (getFile != null)
    //{
    //    // loop through building a collection of attachmentfileviewmodels
    //    foreach (SalesToolsPOCOLibrary.GetThisStationaryFile_Result file in getFile)
    //    {
    //        existingFileName = file.name;
    //        AttachmentViewModel attachmentFile = new AttachmentViewModel();
    //        attachmentFile.HasFile = true;
    //        attachmentFile.FileName = existingFileName;
    //        attachmentFile.StationaryID = attachmentFileModels[0].StationaryID;
    //        attachmentFile.EquipmentID = attachmentFileModels[0].EquipmentID;
 
    //        //attachmentFileModels.Add(attachmentFile);
    //    }
    //}
    if (ModelState.IsValid)
    {
        // loop through the files in the request, not the attachment view model.
        // this is necessary due to the view model having null values for the files in some situations.
        for (int i = 0; i < Request.Files.Count; i++)
        {
            if (Request.Files[i] != null && Request.Files[i].InputStream != null)
            {
                string filename = System.IO.Path.GetFileName(Request.Files[i].FileName);
                byte[] image = new byte[Request.Files[i].InputStream.Length];
                Request.Files[i].InputStream.Read(image, 0, image.Length);
                TempData["FileUploadMessage"] = siteManager.UploadThisStationaryFile(existingFileName, filename, image, attachmentFileModels[0].StationaryID, 0, Constants.FILETYPE_WORKORDER, (int)base.CurrentUserAuth.USR_SecurityUserID, 7);
            }
        }
    }
    else
    {
        ViewBag.CanEdit = IsUserAuthorized(HttpContext.User.Identity.Name, Constants.FW_WORK_ORDERS_ACCESS, Constants.FW_AUTH_EDIT, 0, (int)attachmentFileModels[0].SiteID);
        return PartialView("_FileBrowser", attachmentFileModels);
    }
    return RedirectToAction("EditEquipmentWorkOrder", new { equipmentWorkOrderID = attachmentFileModels[0].StationaryID, siteID = attachmentFileModels[0].SiteID, equipmentID = 0 });
}

Can someone tell me what I am missing in regards to keeping the user in the window?
Dimo
Telerik team
 answered on 07 Jan 2015
4 answers
472 views
Hi,

I have a Grid that I change the data source read URL of dynamically, which works great for updating the data shown in the grid. The data source URL is always targeting a HTTP URI. I've attempted to add the Export to Excel functionality to this grid now, however clicking the export button always sends a HTTP request to the current page (with filter/sorting/etc query parameters) and not to the data source URI.

I have used a simple test grid with a local data source and exporting that works fine.

Can anyone shed some light on this please?

Cheers.
Greg
Top achievements
Rank 1
 answered on 07 Jan 2015
7 answers
1.9K+ views
I have use the latest version to export the kendo grid to excel.  Superb functionality.

(1) I used dataBound event to change some color of the cell in the grid.  How can I put that color to the excel as well? 
(2) I have changed the title name of a column with "<br />" to show 2 lines and it is successful in grid.  But in excel, it just show "<br />".  How can I do the same during export to excel?

Thanks.

$("#gdCombinedReport").kendoGrid({
dataSource: reportDataSource,
sortable: false,
pageable: false,
scrobllable: true,
toolbar: ["excel"],
dataBound: onDataBound3,
excel: {
fileName: "Report.xlsx",
allPages: true
},
columns: [
{ field: "itemName", title: "Item Name", locked: true, attributes: { style: "text-align:left" }, width: "200px" },
{ field: "forecast[0]", title: $scope.titleName[0] + "<br /> January", attributes: { style: "text-align:right" }, width: "90px", format: "{0:c0}" },
Bertha
Top achievements
Rank 1
 answered on 07 Jan 2015
1 answer
176 views
Currently, we can change the displayed record using the dataSource page method:

kendoGrid.dataSource.page(1);

However, sometime we may want to display records based on the index instead of the page number.  Ex: I'm currently trying to create a workaround to select a specific row using an index value when the virtual scrolling is enable (this feature isn't supported by Kendo yet).  I'm almost done but the only thing missing to complete this workaround is a way load records based on their index.

After taking a look at the grid behavior, I came to the conclusion there's probably an internal function in the grid that would allow us to do such task.  Indeed, when you scroll using the virtual scrollbar, the grid's tbody rows that gets loaded are often independent from the page.

Ex:  If your dataSource has a pageSize of 100, you would expect the grid to load index 0 to 99 / 100 to 199 / 200 to 299... however, when you look at rows inside the tbody, you'll find out that the displayed rows are not directly linked to the current page so you may end with 100 rows starting from index 96 to 195.

Is there a way to invoke or trigger the function that would change the displayed record based on an index range, like the grid does internally?

Best regards,

Simon

N.B. When the grid send the OData request to the servers it still follows the expected index sequence based on a requested page number...  however, bringing record 100 to 199 from the server doesn't mean they will be the one displayed in the tbody.
Alexander Popov
Telerik team
 answered on 07 Jan 2015
5 answers
305 views
Dear Telerik Team,

I have a file structure that is stored in a database (folders, subfolders, items). The names of the directories and files are not unique, but each folder and file has a unique id. I've written a custom Read method for the imagebrowser, but I see that the javascript only sends the path, containing the directory names, when navigating in the image browser. Is there any way to make the imagebrowser send the id of the folder instead of the path.
I could put the id in the name field, but then this is the name the users see in the image browser (which is not what I want), is there a function I can set to show a different name?

Thanks
Dimo
Telerik team
 answered on 07 Jan 2015
1 answer
92 views
Hi

I have one of my columns set to "editable:false".
http://jsfiddle.net/8ythhp1r/1/
When I click "Edit" in this example the text of the column which is set to "editable:false" is not properly positioned!

Is this a soon-to-be-fixed bug?

Thanks
Vladimir Iliev
Telerik team
 answered on 07 Jan 2015
1 answer
1.2K+ views
According to many example, it seems the getKendoGrid() function has replaced the way to access the kendo grid object (.data("kendoGrid").

The same kind of change has been made for different widgets, but I can't any reference to those function in the API documentation.

Are those functions documented anywhere?

Best regards,

Simon
Alexander Valchev
Telerik team
 answered on 07 Jan 2015
3 answers
57 views
The paging functionality of this forum placed at bottom shows an error page (404) when we try to use it.
Kristina
Telerik team
 answered on 07 Jan 2015
1 answer
119 views
Hi Guys,

Have just tripped over a little issue with the Column Menu not being painted correctly when using the Bootstrap Theme, which can be replicated as follows:

- Run the Column Menu demo

- Select the Bootstrap Theme

- Select the Column Menu on the Order ID column and hover over the Column item
    The item turns blue and the background of the sub menu is white

- Now select the Column Menu on the ShipAddress column and hover over the Column item
    This time the item remains grey but the background of the sub menu turns blue


Checking the other themes they all show a consistent background colour on the left & right sub menus so I suspect something is amiss in the Bootstrap Theme CSS

Regards
Alan

Iliana Dyankova
Telerik team
 answered on 07 Jan 2015
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
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?