Telerik Forums
Kendo UI for jQuery Forum
0 answers
147 views
Hi,

Currently i have inline editing grid as in the following, I have drop down list in coloumn CStatusID, However, it does not selected value into when trying to save to database

VIEW:

@(Html.Kendo().Grid(Model)
    .Name("SList")
        .HtmlAttributes(new { @Style = "align:center; font-size:10px;" })
    .Columns(columns => {
        columns.Bound(p => p.CCID);
        columns.Bound(p => p.CRN);
        columns.Bound(p => p.CStatusID).EditorTemplateName("CStatus
");
        columns.Bound(p => p.DateScheduled).Format("{0:MM/dd/yyyy}");
  
        columns.Command(commands => commands.Edit()).Width(175);
    })
    //.ToolBar(toolBar => toolBar.Save())
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable()
    .Sortable()
    .Scrollable()
    .Navigatable()
    .Selectable(selectable => selectable.Mode(GridSelectionMode.Single)
                                        .Type(GridSelectionType.Row))
    .DataSource(dataSource => dataSource        
        .Ajax()
        .PageSize(10)   
        .Model(model => model.Id(p => p.ConsumerID))
        .Read(read => read.Action("Index", "Management"))
        .Update(update => update.Action("Edit", "Management"))
      
    )
)

and I have CStatus.cshtml under shared/Editor template:
@(Html.Kendo().ComboBox()
        .Name("Status")
        //.OptionLabel("Select status")
        .DataValueField("OptID")
        .DataTextField("OptName")
        .BindTo((System.Collections.IEnumerable)ViewData["constStatus"])
    
        
)

Controller:

public ActionResult Index()
        {
            PopulateConstStatus();
            return View();
        }

private void PopulateConstStatus()
        {
            ViewData["constStatus"] = new EDEntities().COptions
                       .Select(e => new ConfOptModel
                       {
                           OptionID = e.OptID,
                           OptionName = e.OptName,
                           CTypeID = e.CTypeID
                       })
                       .Where(e => e.CTypeID == 2)
                       .OrderBy(e => e.OptName);
        }


Model

public int OptID { get; set; }
public string OptName { get; set; }

[UIHint("CStatus")]
public COptionsModel COptionsModel { get; set; }
Mark
Top achievements
Rank 1
 asked on 19 Oct 2012
1 answer
279 views
Similar to the PanelBar, I require that only one row entry hierarchy stays open at a time, in particular, when a row is in edit mode.

It is insufficient to bind a "open/close this row" to update and edit because it does not handle the case where the user edits another row or clicks cancel.

I've tried everything but nothing works. Help!
Phil
Top achievements
Rank 1
 answered on 18 Oct 2012
4 answers
378 views
Hi, 

I can't get the select event on the tabstrip working. It should log a console message that the select event was fired, but it does nothing. What am I doing wrong?

HTML markup:
<div data-role="layout" data-id="mobile-tabstrip">
    <div data-role="footer">
        <div data-role="tabstrip" id="tabStrip">
            <a href="#user" data-icon="contacts">User</a>
            <a href="#cycle" data-icon="play">Cycle</a>
            <a href="#stats" data-icon="toprated">Stats</a>
            <a href="#settings" data-icon="settings">Settings</a>
        </div>
    </div>
</div>

JS code:
var tabstripBound = false;
        var app = new kendo.mobile.Application($(document.body), {
            platform : "android",
            viewShow: function() {
                 if (!tabStripBound) {
                 var tabStrip = $("#tabStrip").data("kendoMobileTabstrip");
                 tabStrip.bind("select", onSelect);
                 tabStripBound = true;
                 }
              }
        });
         
        function onSelect(item){
            console.log("In on select");
        }
Shawn
Top achievements
Rank 2
 answered on 18 Oct 2012
8 answers
2.7K+ views
good morning everyone,

how are you?  I am currently using the licensed version of Kendo UI Complete for ASP.NET MVC (Q2 2012) and trying to figure out how to wire up javascript to the "Edit" and "Delete" grid commands.  the following is the code i have:

@(Html.Kendo().Grid<UserViewModel>()
                .Name("grdAllUsers")
                .Columns(columns =>
                {
                    columns.Bound(o => o.Id)
                        .Visible(false);
                    columns.Bound(o => o.UserName)
                        .Width(150);
                    columns.Bound(o => o.EmailAddress)
                        .Width(275);
                    columns.Bound(o => o.IsActive)
                        .Width(75)
                        .Filterable(false)
                        .HtmlAttributes(new { style = "text-align: center;" })
                        .ClientTemplate("<input readonly='readonly' type='checkbox' disabled='disabled' name='chkIsActive#=Id#' id='chkIsActive#=Id#' #= IsActive? \"checked='checked'\" : \"\" # />");
                    columns.Command(command =>
                    {
                        command.Edit();
                        command.Destroy();
                    });
                })
                .DataSource(dataSource =>
                {
                    dataSource.Ajax()
                        .Model(model => model.Id(o => o.Id)) // DataKey
                        .PageSize(15)
                        .Read(read => read.Action("Read", "Users"));
                        //.Destroy(destroy => destroy.Action("", ""));
                })
                .Pageable(paging =>
                {
                    paging.Numeric(true)
                        .Info(true)
                        .PreviousNext(true)
                        .Refresh(true);
                })
                .Sortable()
                .Filterable()
            )

i don't want to use the "Custom" command.

command.Custom("blah").Click("");

is there a way to do this, wiring up javascript to the grid "Edit" and "Delete" commands???

Thank you very much for all your help.

have a great day.
Sam
Top achievements
Rank 1
 answered on 18 Oct 2012
0 answers
129 views
Basically, I've seen that datasource's schema configurations support an "errors" field, and the datasource has an error event. I want to be able to pass back errors from my MVC controller, and have them be reported using the same error handler on the client side.

What do I need to do to get this to work? Specifically, what format does my returned errors have to be for the datasource to recognize it as errors and fire the event? Is there anything else I need to set on the datasource besides "schema.errors" and the error event handler? Currently I am just returning an object with a field "errors" that contains and array of strings, but that doesn't seem to trigger it. What am I doing wrong?

Thanks.
Joshua
Top achievements
Rank 1
 asked on 18 Oct 2012
2 answers
160 views
Dear,
I've two question about select a row in grid:

1) How I must call select method to select a second row of grid, or third row, ecc... (not the first row as your example)
2) How I must call select method to select a row that a certain field contains a specific value ?

Thanks,
Rinaldo
Rinaldo
Top achievements
Rank 1
 answered on 18 Oct 2012
5 answers
220 views
The sizeField value must be too wide to see a difference..



If the sizeField value difference is like some hundredths then most of the bubbles are drawn almost the same size. Is there a way to tweak this, to make size more significant if the difference between values are 100->1000 or more?



Thanks
Joe Sugden
Top achievements
Rank 1
 answered on 18 Oct 2012
0 answers
202 views
This is what I have. why is DetailTemplate saying "Cannot use only server templates in Ajax or WebService binding mode. Please specify a client template as well."  I am only using one datasource.



@(Html.Kendo().Grid(Model.ProcessHistoryItems)
      .Resizable(resize=>resize.Columns(true))
      .Groupable(group=>group.Enabled(true))
      .Name("GridHistory").Navigatable()
      .Columns(columns =>
                   {
                       columns.Bound(item => item.ProcessorCode).Width(200);
                       columns.Bound(item => item.CreatedBy).Width(150); 
                       columns.Bound(item => item.StartDate).Width(150);
                       columns.Bound(item => item.EndDate).Width(150);
                       columns.Bound(item => item.Parameters).Width(375);
                       columns.Bound(item => item.Exception).Width(100);
                       columns.Bound(item => item.Status).Width(100);
                  }
                   ).Pageable(pager => pager
                             .Input(true)
                             .Numeric(true)
                             .Info(true)
                             .PreviousNext(true)
                             .Refresh(true)
                             .PageSizes(true)
      ).DetailTemplate(detail=>  @Html.Kendo().Grid(detail.ChildProcesses)
                                       .Name("DetailHistory")
                                       .Columns(columns =>
                                                    {
                                                        columns.Bound(item => item.ProcessorCode).Width(250);
                                                        columns.Bound(item => item.CreatedBy).Width(100);
                                                        columns.Bound(item => item.StartDate).Format("{0:MM/dd/yyyy hh:mm:ss}").Width(200);
                                                        columns.Bound(item => item.EndDate).Width(200);
                                                        columns.Bound(item => item.Parameters).Width(200);
                                                        columns.Bound(item => item.Exception).Width(100);
                                                        columns.Bound(item => item.Status).Width(100);
                                                    })                                   
      .Resizable(resize=>resize.Columns(true)).Scrollable().Sortable(sort=>sort.Enabled(true)).Filterable(filter=>filter.Enabled(true))
     
                                               ).DataSource(dataSource => dataSource
                                        .Ajax()
                                        .Read(read => read.Action("Refresh", "ProcessServer"))
                                        .Model(m=>m.Id(p=>p.ProcessorCode)))
      ) 
Osman
Top achievements
Rank 1
 asked on 18 Oct 2012
0 answers
140 views
how to use kendo ui upload file in codegniter, simply i upload file in codigniter  but in add and edit form it cant work i mean it cant save in particular directory.

<input name="files" id="files" type="file" />

$(document).ready(function () {
$("#files").kendoUpload({
                async: {
                    saveUrl: "<?php  echo base_url(); ?>upload_plan_image",
                    removeUrl: 'remove.php',
                    autoUpload: true
                }
            });
 });


$("#grid").kendoGrid({
            dataSource: dataSource,
            pageable: true,
            height: 400,
            
            toolbar: [{name:"create",text:"Add new Plan"}],
            columns: [                          
                {field:"plan_img_file", title:"PlanImgFile"}, 
                {command: ["edit", "destroy"], title: "&nbsp;", width: "210px",title:"Action" }],     
            groupable:true,
            editable: {
                mode: "popup",           
                destroy: true,             
                confirmation: "Are you sure you want to remove this test member?"
            }
        });
Kartik
Top achievements
Rank 1
 asked on 18 Oct 2012
0 answers
257 views
I am working on adding and editing items on my grid and occasionally I will get an error back from the server if there is a problem with the submission (i.e. username already exists, etc.).  I would like to handle this error gracefully and let the user re-edit the line and re-submit the changes.  Right now, it just looks like it changes in the grid but it doesn't actually update.

Here is what I have:
$("#tblCompanies").kendoGrid({
    dataSource: new kendo.data.DataSource({
        type: "json",
        transport: {
            read: {
                url: "http://192.168.1.33:8090/pumpSystem/getProdCompanyList",
                dataType: "json",
                type: "GET"
            },
            update: {
                url: "http://192.168.1.33:8090/pumpSystem/updateProductionCompany",
                dataType: "json",
                type: "POST"
            },
            create: {
                url: "http://192.168.1.33:8090/pumpSystem/addProductionCompany",
                dataType: "json",
                type: "POST"
            }
        },
        schema: {
            model: {
                id: "Id",
                fields: {
                    Id: { type: "number", editable: false },
                    CompanyId: { type: "number", validation: { required: true, min: 1} },
                    Name: { type: "string", validation: { required: true} },
                    isEnabled: { type: "boolean" }
                }
            }
        }
 
    }),
    columns: [
        { field: "CompanyId", title: "CompanyID", width: "60px" },
        { field: "Name", title: "Name", width: "150px" },
        { field: "isEnabled", title: "Enabled", width: "60px" },
        { command: ["edit"], width: "150px" }
    ],
    editable: "inline",
    toolbar: ["create"]
 
});

If there is an error on the add or update then I will get a JSON response from the server -- some thing like this: 

"[{'error','CompanyId already in system'}]"

Any ideas on how I can use the datasource and/or grid to process this error response and allow the user to re-edit??

Thanks so much!!!
Kristin
Top achievements
Rank 1
 asked on 18 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
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
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
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?