Telerik Forums
Kendo UI for jQuery Forum
3 answers
194 views
I'm trying to display details in a grid, but when I put breakpoints in the controller, the app is ignoring the .Read and never hits the controller after the initial load of the page.

Here's my Index.cshtml:

@functions {

    private void AccountGridCommandDef(GridColumnFactory<PosPayAndBankRec.Models.AccountListItem> columns)
 {
  columns.Command(command => { command.Edit(); command.Destroy(); }).Width(180);
        columns.Bound(p => p.AccountID).Hidden();
        columns.Bound(p => p.SourceName).Title("Source");
        columns.Bound(p => p.BankName).Title("Bank");
        columns.Bound(p => p.AccountName).Title("Account");
        columns.Bound(p => p.AccountNumber).Title("Acct #");
        columns.Bound(p => p.AccountFolderName).Title("Folder");
        columns.Bound(p => p.RamQuestBankNumber).Title("Bank #");
        //columns.ForeignKey(p => p.AccountID, (IEnumerable<ORTAccount>)ViewBag.Accounts, "AccountID", "AccountName");
 }

 private void AccountGridDataSource(DataSourceBuilder<PosPayAndBankRec.Models.AccountListItem> dataSource)
 {
        dataSource.Ajax()
            .Model(AjaxDataSourceBuilder)
            .Sort(sort => sort.Add(p => p.BankName))
            .ServerOperation(true)
            .Create(create => create.Action("Create", "Account"))
            .Read(read => read.Action("Read", "Account"))
            .Update(update => update.Action("Update", "Account"))
            .Destroy(destroy => destroy.Action("Delete", "Account"));
            //.Events(e => e.Error("error"));
 }

 private void AjaxDataSourceBuilder(DataSourceModelDescriptorFactory<PosPayAndBankRec.Models.AccountListItem> model)
 {
        model.Id(p => p.AccountID);
        model.Field(p => p.AccountName);
 }

 private void AccountGridToolBarDef(GridToolBarCommandFactory<PosPayAndBankRec.Models.AccountListItem> toolbar)
 {
  toolbar.Create().Text("New Account");
 }
}

@{ ViewBag.Title = "Accounts"; }
@(Html.Kendo().Grid<PosPayAndBankRec.Models.AccountListItem>()
 .Name("Accounts")
 .Columns(AccountGridCommandDef)
 .DataSource(AccountGridDataSource)
        .ToolBar(AccountGridToolBarDef)
        .Editable(c => c.Mode(GridEditMode.PopUp).Enabled(true).DisplayDeleteConfirmation(true).Window(window => window.Title("Account")).TemplateName("AccountPopup").AdditionalViewData(new { Sources = Model.Sources, Banks = Model.Banks }))
 .Sortable()
    .ClientDetailTemplateId("AccountDetails")
 .Pageable(p => p.Enabled(false))
 .Scrollable(s => { s.Height(375); s.Virtual(true); })
)

     

<script id="AccountDetails" type="text/kendo-tmpl">
    @(Html.Kendo().TabStrip()
            .Name("TabStrip_#=AccountID#")
            .SelectedIndex(0)
            .Items(items =>
                       {
                           items.Add().Text("Details").Content(
                               @<text>
                    @(Html.Kendo().Grid<PosPayAndBankRec.Models.AccountListItem>()
                            .Name("Details_#=AccountID#")
                            .Columns(columns =>
                                        {
                                            columns.Bound(p => p.BankAccountName).Width(101);
                                            columns.Bound(p => p.RamQuestDatabaseName).Width(140);
                                            columns.Bound(p => p.RamQuestBankNumberStacked).Width(200);
                                            columns.Bound(p => p.AccountNotes).Width(200);
                                        })
                            .DataSource(dataSource => dataSource
                                                        .Ajax()
                                                        .Read(read => read.Action("Details", "Account", new {id = "#=AccountID#"}))
                            )
                            .Pageable()
                            .Sortable()
                            .ToClientTemplate())
                </text>);




Here's my AccountController.cs:

using System.Linq;
using System.Linq.Expressions;
using System.Web;
using System.Web.Mvc;
using PosPayAndBankRec.Domain.Models;
using System.Data.Entity;
using PosPayAndBankRec.Models;
using System.Data.Entity.Validation;
using Kendo.Mvc.UI;
using Kendo.Mvc.Extensions;

namespace PosPayAndBankRec.Controllers
{
    public class AccountController : BaseController
    {
        private EFTDBContext db = new EFTDBContext();

        public ActionResult Read([DataSourceRequest] DataSourceRequest request)
        {
            var ortaccounts = (from account in db.ORTAccounts
                              join source in db.ORTSources on account.SourceID equals source.SourceID
                              join bank in db.ORTBanks on account.BankID equals bank.BankID
                              select new AccountListItem()
                              {
                                  AccountID = account.AccountID,
                                  BankID = account.BankID,
                                  SourceID = account.SourceID,
                                  AccountName = account.AccountName,
                                  AccountNumber = account.AccountNumber,
                                  AccountFolderName = account.AccountFolderName,
                                  BankAccountName = account.BankAccountName,
                                  BankName = bank.BankName,
                                  RamQuestBankNumber = account.RamQuestBankNumber,
                                  SourceName = source.SourceName,
                                  RamQuestDatabaseName = account.RamQuestDatabaseName,
                                  RamQuestBankNumberStacked = account.RamQuestBankNumberStacked,
                                  AccountNotes = account.AccountNotes
                              }).ToDataSourceResult(request);

            //var sources = db.ORTSources.ToDataSourceResult(request);
            //var banks = db.ORTBanks.ToDataSourceResult(request);

            //return View(viewData);
            return Json(ortaccounts, JsonRequestBehavior.AllowGet);
        }

        [HttpGet]
        public ActionResult Details(int id)
        {
            var ortaccounts = from account in db.ORTAccounts
                              join source in db.ORTSources on account.SourceID equals source.SourceID
                              join bank in db.ORTBanks on account.BankID equals bank.BankID
                              where account.AccountID == id

                             select new AccountDetailsModel()
                              {
                                  AccountID = account.AccountID,
                                  AccountFolderName = account.AccountFolderName,
                                  AccountName = account.AccountName,
                                  AccountNumber = account.AccountNumber,
                                  BankID = account.BankID,
                                  BankName = bank.BankName,
                                  RamQuestBankNumber = account.RamQuestBankNumber,
                                  SourceName = source.SourceName,
                                  AccountNotes = account.AccountNotes,
                                  BankAccountName = account.BankAccountName,
                                  RamQuestDatabaseName = account.RamQuestDatabaseName,
                                  RamQuestBankNumberStacked = account.RamQuestBankNumberStacked
                              };
            var ortaccount = ortaccounts.FirstOrDefault();
            if (ortaccounts == null)
            {
                return RedirectToAction("Error");
            }
            else
            {
                return View(ortaccount);
            }
        }

Alex
Top achievements
Rank 1
 answered on 02 Oct 2012
9 answers
556 views
I have a grid that has a large number of columns (50).  Although the user will likely only select a few columns to view, he/she needs the ability to select from any of the 50 columns. Unfortunately, on most displays, the kendo grid column menu will be greater than the display. Is there a way to make the column menu scrollable or set sub-menus (that contain groups of columns) within the column menu?
James
Top achievements
Rank 1
 answered on 02 Oct 2012
0 answers
58 views
I have a custom function to conditionally color some of my cells in a kendo grid. 
I would like to call it everytime the grid needs it. so after it refreshes, after databinding and after sort or any grid change..... and so on

can I do it without using a template? thanks
Vland
Top achievements
Rank 1
 asked on 02 Oct 2012
1 answer
82 views
I'm not sure if this is a known issue but I was unable to find any related posts on the forums. On an iPad with iOS 5 or iOS 6, if you press into a numeric textbox, the first press does not bring up the keyboard. The first press only changes the input to numbers only (if it was a currency or percent). The second press brings up the keyboard.

Is there a way I can change the inputs so that the keyboard opens on the first press?

I was able to re-create this issue using the Globlization demos found here (as well as my own code): http://demos.kendoui.com/web/globalization/index.html.
Georgi Krustev
Telerik team
 answered on 02 Oct 2012
0 answers
217 views
Is there a list of unallowed parameter names?

I had

schema: {
                model: {
                    id: "id",
                    hasChildren: "hasChildren",
                    children: "items",
                    fields: {
                        level: {
                            type: "number",
                            editable: true,
                            nullable: false
                        }
                    }
                }
            }

Which kept failing for some unknown reason.  Eventually I tried changing a working dataSource's extra param to "level" and it started failing.  Then I realized that "level" must already be used in dataSource or something.
Kuangyi
Top achievements
Rank 1
 asked on 02 Oct 2012
1 answer
253 views
I am using an autocomplete control:

var data = ["Books", "Movies", "Music"];

$("#input").kendoAutoComplete({
    dataSource: data,
    placeholder: "Select Category..."
});

For some reason the list of options is replacing the text box instead of showing below the input box. See the attached screenshots.

Why is this happening?

Pechka
Top achievements
Rank 1
 answered on 02 Oct 2012
2 answers
191 views
I'm having weird display behavior with datetime and drop down component.
The problem is that the dropdown selection remains partially visible when viewing with chrome.

view this demo with chrome to get the weird behavior.
small demo that reproduced the behavior : http://jsbin.com/aziveh/6 and   http://embed.plnkr.co/WHdj3d

When you view the same demo in http://plnkr.co/edit/WHdj3d the behavior disappears.This only happens when using chrome.

 kind regards,
Doni




 
Doni
Top achievements
Rank 1
 answered on 02 Oct 2012
3 answers
306 views
Hi,

Having had mild success with putting a chart into a mobile UI project, I'm trying to take the dashboard demo at
http://demos.kendoui.com/dataviz/dashboards/stock-history.html
and put that into a mobile UI as per one of the demo images showing a dashboard on the iphone (http://www.kendoui.com/Libraries/elements/dataviz-1.sflb.ashx)

I can't get the charts to display, and I again have trouble with the mobile UI tabstrip disappearing completely.

I've created a JS Bin project here: http://jsbin.com/welcome/26994/

Any pointers would be appreciated.

Thanks
Hayden

Jordan
Telerik team
 answered on 02 Oct 2012
1 answer
197 views
Hello
I have tried and search for solution to modify Column template 
e.g.

$("#gridscreenerconfigs").kendoGrid({
                groupable: false,
                sortable: false,
                scrollable: {
                    virtual: true
                },
                filterable: false,
                pageable: false,
                columns: [{
                    field: "fEnable",
                    title: "Enable"
                }, {
                    field: "fCategories",
                    title: "Screener"
                }, {
                    field: "fRange",
                    title: "Range"
                }, {
                    field: "fReorder",
                    title: "Order"
                }, {
                    command: "destroy",
                    title: "Remove"
                }
                ]
            });

i tried some thing like

var grid = $("#gridName").data("kendoGrid");
            grid.columns = [];
            $("#gridscreenerresult").kendoGrid({
                groupable: false,
                sortable: {
                        mode: "multiple",
                        allowUnsort: true
                },
                reorderable: true,
                columnMenu: true,
                scrollable: {
                    virtual: true
                },
                filterable: false,
                resizable: true,
                pageable: {
                    refresh: true,
                    pageSizes: true
                },
                columns: columnfield2
            });
            grid.refresh();

Nothing works so far, is it possible at all?


Hi If adding removing columns not work during runtime with javascript then can you guys show me how to show / hide columns on runtimes programatically? this way i can still complete my project. If all is not well, i will have to roll back to Telerik Ajax instead - spent tons of times on Kendo already.
Dimo
Telerik team
 answered on 02 Oct 2012
1 answer
137 views
How do i to change the item template from de Panelbar in order to add new attributes to the li element?
How can a access the datasource item for the select item?
Iliana Dyankova
Telerik team
 answered on 02 Oct 2012
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
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?