We want to filter all grid columns by a single input-field. When we define the type of one column as number, the filter doesn't work.
http://dojo.telerik.com/@brandung/uTaGE/5
Hello Eveyone
Our company use Kendo Window to present content.
But the user keep Open and Close and Open....
It's cause the memory leak.
Is any way to slove this problem?
Thanks all.
function onSelectNode( e )
{
var dataItem = this.dataItem( e.node );
dataItem.imageUrl = "someImage.png";
]
Hello,
I am wondering if there is UI kit for Adobe XD available for download.
Hi,
I need the legend to be scrollable because when there's too many items things begin to overlap.
Is there any way to make the legend scrollable.
Hey guys,
Here's the thing, I have a dropdownlist populated already (use datasource in case this info is needed, since the info comes from an endpoint) and it has to be this function so that the user types anything (on an input generated by the method "filter" )and the data gets filtered, but i want to do it at the client side so in that case i wouldn't have to change any c# code. So i found out there's this method "filtering" but i didn't found an example of how to apply it, so i'm here in looking for any guidance.
Hope you understand my doubt.
Regards.
Hello,
I'm using a kendoMenu item as a toolbar option in a kendo grid. This worked fine until one of the newer releases and the animated dropdown panel now shows behind the grid as shown here:
https://jsfiddle.net/k1d4aufr/
Previous versions of kendo did not have this problem:
https://jsfiddle.net/jddevight/Ltgvk2sf/
I've tried setting the z-index on the animated panel and nothing works. Any ideas?
Thanks,
Matt
I would like to create a custom filter for a kendo ui grid with the following requirements:
I tried following this Dojo: https://dojo.telerik.com/EVEwuREK but it only got me part way there as I do not know how to override the filter button and include the filters from the other columns. In this example, there is no submit or clear button so if the user enters dates they can't bet back to the full list and if they filter by column that filter gets cleared when filtering by date. It also produces unexpected results depending on whether you filter by country or date first.
I made a sample Dojo here which shows the bug with filtering: Dojo
Steps to Reproduce:
I am having an issue with the breadcrumb feature in the File Manager widget. No matter which breadcrumb link I click, it always takes me to the home directory. When I inspect the link, href is set to "#" for all of them. I'm not sure what I'm missing to make this work correctly. I've included my javascript, controller, and view. If other code is needed I can provide it. Thanks in advance for any help!
Javascript:
function loadFileManager() {
$("#fileManager").kendoFileManager({
draggable: false,
resizable: true,
dataSource: {
transport: {
read: {
url: $('#urlHolders').data('readFilesUrl'),
method: "POST"
},
create: {
url: $('#urlHolders').data('createFileUrl'),
method: "POST"
},
update: {
url: $('#urlHolders').data('updateFileUrl'),
method: "POST"
},
destroy: {
url: $('#urlHolders').data('destroyFileUrl'),
method: "POST"
}
}
},
uploadUrl: $('#urlHolders').data('uploadFileUrl'),
toolbar: {
items: [
{ name: "upload" },
{ name: "sortDirection" },
{ name: "sortField" },
{ name: "changeView" },
{ name: "spacer" },
{ name: "details" },
{ name: "search" }
]
},
contextMenu: {
items: [
{ name: "rename" },
{ name: "delete" },
{ name: "download", text: "Download", command: "DownloadCommand", spriteCssClass: "k-icon k-i-download" }
],
open: function (e) {
//Executes when an item is right-clicked, before the context menu opens
//We only want context menu actions to be available for files, not folders. So we intercept that here
//Check whether the clicked item was a treeview item (folder)
var isTreeviewItem = $(e.target).hasClass('k-treeview-item');
//Check the clicked item for the folder icon class
var isFolder = e.target.querySelector('.k-i-folder') != null;
//if the clicked item a folder, do not open the context menu
if (isTreeviewItem || isFolder) {
e.preventDefault();
}
}
}
});
var fileManager = $("#fileManager").getKendoFileManager();
fileManager.executeCommand({ command: "TogglePaneCommand", options: { type: "preview" } });
fileManager.toolbar.fileManagerDetailsToggle.switchInstance.toggle();
var filemanagerNS = kendo.ui.filemanager;
filemanagerNS.commands.DownloadCommand = filemanagerNS.FileManagerCommand.extend({
exec: function () {
var that = this,
filemanager = that.filemanager, // get the kendo.ui.FileManager instance
options = that.options, // get the options passed through the tool
target = options.target // options.target is available only when command is executed from the context menu
selectedFiles = filemanager.getSelected(); // get the selected files
window.location = '/FileManager/Download?path=' + selectedFiles[0].path;
}
});
}
View:
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">File Manager</h1>
</div>
<div id="fileManagerContainer" class="wrapper">
<div id="fileManagerContent">
<div id="fileManager" class="rounded"></div>
</div>
</div>
@section scripts {
<script type="text/javascript">
$(function () {
loadFileManager();
});
</script>
}
Controller:
public class HomeController
{
private readonly FileContentBrowser directoryBrowser;
private const string contentFolderRoot = @"C:\Users\anna\Desktop\FileManagerContent";
public HomeController(IPatientListService patientListService)
{
directoryBrowser = new FileContentBrowser(patientListService); // Helper utility for the FileManager controller
}
public ActionResult Index()
{
_auditService.LogEvent(new AuditEventModel
{
EventDef = EventDefinitions.PageOpened,
EventItemName = AuditHelper.PageOpenedEventItemName(this.ControllerContext.RouteData)
});
return View("Index");
}
#region File Manager
/// <summary>
/// Gets the valid file extensions by which served files will be filtered.
/// </summary>
public string Filter
{
get
{
return "*.*";
}
}
public JsonResult Read(string target)
{
var path = (string.IsNullOrWhiteSpace(target)) ? contentFolderRoot : target;
int userId = User.Identity.GetUserId();
try
{
directoryBrowser.Server = Server;
var result = directoryBrowser.GetFiles(path, Filter).Concat(directoryBrowser.GetDirectories(path, userId));
return Json(result, JsonRequestBehavior.AllowGet);
}
catch (DirectoryNotFoundException)
{
throw new HttpException(404, "File Not Found");
}
throw new HttpException(403, "Forbidden");
}
/// <summary>
/// Updates an entry with a given entry.
/// </summary>
/// <param name="target">The path to the parent folder in which the folder should be created.</param>
/// <param name="entry">The entry.</param>
/// <returns>An empty <see cref="ContentResult"/>.</returns>
/// <exception cref="HttpException">Forbidden</exception>
public ActionResult Update(string target, FileManagerEntry entry)
{
FileManagerEntry newEntry;
newEntry = RenameEntry(entry);
return Json(newEntry);
}
public FileManagerEntry RenameEntry(FileManagerEntry entry)
{
var path = entry.Path;
var physicalTarget = EnsureUniqueName(Path.GetDirectoryName(path), entry);
FileManagerEntry newEntry;
var file = new FileInfo(path);
System.IO.File.Move(file.FullName, physicalTarget);
newEntry = directoryBrowser.GetFile(physicalTarget);
return newEntry;
}
public string EnsureUniqueName(string target, FileManagerEntry entry)
{
//Remove any extra file extensions that the user may have typed
while (entry.Name.EndsWith(entry.Extension))
{
entry.Name = entry.Name.Remove(entry.Name.Length - entry.Extension.Length);
}
var fileName = entry.Name + entry.Extension;
int sequence = 0;
var physicalTarget = Path.Combine(target, fileName);
//If the file name already exists, tack on a sequence #
while (System.IO.File.Exists(physicalTarget))
{
fileName = entry.Name + String.Format("({0})", ++sequence) + entry.Extension;
physicalTarget = Path.Combine(target, fileName);
}
return physicalTarget;
}
[HttpGet]
public FileResult Download(string path)
{
FileInfo file = new FileInfo(path);
System.Net.Mime.ContentDisposition cd = new System.Net.Mime.ContentDisposition
{
FileName = file.Name,
Inline = false
};
Response.Headers.Add("Content-Disposition", cd.ToString());
Response.Headers.Add("X-Content-Type-Options", "nosniff");
string contentType = MimeMapping.GetMimeMapping(file.Name);
var readStream = System.IO.File.ReadAllBytes(path);
return File(readStream, contentType);
}
public ActionResult Destroy(FileManagerEntry entry)
{
var path = entry.Path;
if (!string.IsNullOrEmpty(path))
{
DeleteFile(path);
return Json(new object[0]);
}
throw new HttpException(404, "File Not Found");
}
public void DeleteFile(string path)
{
if (System.IO.File.Exists(path))
{
System.IO.File.Delete(path);
}
}
/// <summary>
/// Uploads a file to a given path.
/// </summary>
/// <param name="path">The path to which the file should be uploaded.</param>
/// <param name="file">The file which should be uploaded.</param>
/// <returns>A <see cref="JsonResult"/> containing the uploaded file's size and name.</returns>
/// <exception cref="HttpException">Forbidden</exception>
[AcceptVerbs(HttpVerbs.Post)]
public virtual ActionResult Upload(string path, HttpPostedFileBase file)
{
var fileName = Path.GetFileName(file.FileName);
if (true)
{
file.SaveAs(Path.Combine(path, fileName));
return Json(new
{
size = file.ContentLength,
name = fileName,
type = "f"
}, "text/plain");
}
throw new HttpException(403, "Forbidden");
}
}