Telerik Forums
Kendo UI for jQuery Forum
3 answers
85 views
For instance, it might fire the create event on every CRUD event.  I cannot say it is always the case, but it appears to normally be re-firing an event that was already fired (and processed).

My grid is bound to a ModelView for the and we actual do the update on the database model, but i always fill in the key on the object that was passed in and then return the modelView. 

Below is an example of the grid in my view:
             @(
Html.Kendo().Grid<.Models.ConnectionView>()
       .Name("ConnectionView")
       .Columns(columns =>
           {
               columns.ForeignKey(c => c.ConnId, Model.All, "Value", "Text").Title("Restriction");
               columns.Bound(c => c.MaxEnrollment);
               columns.Command(command =>
                       {
                           command.Custom("move-up").Text("u").Click("OnMoveUp");//, "Home", new {Area="Sessions",id="#=Id#" });
                           command.Custom("move-down").Text("d").Click("OnMoveDown");//, "Home", new { Area = "Sessions", id = "#=Id#" });
                           command.Edit();
                           command.Destroy();
                       });
           })
           .Pageable(page =>
                   {
                       page.Enabled(true);
                       page.Input(false);
                       page.Numeric(false);
                       page.PreviousNext(true);
                       page.Messages(message => message.Empty("There are no records to show.  Click the Add button to create a row"));
                   })
           .ToolBar(toolbar => toolbar.Create().Text("Add"))
           .Editable(editable => editable.Mode(GridEditMode.InLine))
           .DataSource(dataSource => dataSource
           .Ajax()
           .Events(events =>
               {
                   events.Error("error_handler");
               })
           .Model(model =>
               {
                   model.Id(m => m.Id);
                   model.Field(m => m.ConnId).DefaultValue(int.Parse(Model.All.First().Value));
               })
           .Create(update => update.Action("ConnectionView_Create", "Home"))
           .Read(read => read.Action("ConnectionView_Read", "Home"))
           .Update(update => update.Action("ConnectionView_Update", "Home"))
           .Destroy(update => update.Action("ConnectionView_Destroy", "Home"))
           )
Example of my create method:
public ActionResult RestrictionConnectionView_Create([DataSourceRequest] DataSourceRequest request, RestrictionConnectionView connector)
{
    var newConn = new OrientationSession_RestrictionConnector();
    if (ModelState.IsValid)
    {
        var restrictionRepo = new EFRepository<Restriction>(_uow);
        var restriction = restrictionRepo.GetByKey(connector.RestrictionId);
        var repo = new EFRepository<Conn>(_uow);
        var session = repo.WhereIncluding(w => w.Id == _WorkingSessionId, i => i.RestrictionConnectors).FirstOrDefault();
 
        if (session != null && restriction != null)
        {
            newConn.OrientationSessionId = _WorkingSessionId;
            newConn.Restriction = restriction;
            newConn.MaxEnrollment = connector.MaxEnrollment;
            newConn.CreatedBy = User.Identity.Name;
            newConn.SequenceNumber = session.RestrictionConnectors == null || session.RestrictionConnectors.Count == 0 ? 1 : session.RestrictionConnectors.Max(m => m.SequenceNumber) + 1;
 
            session.RestrictionConnectors.Add(newConn);
            repo.Update(session);
            _uow.Commit();
            ResetSessionVars();
        }
    }
 
    connector.Id = newConn.Id;
 
    return Json(new[] { connector }.ToDataSourceResult(request, ModelState));
}

Thanks,
Logan
Vladimir Iliev
Telerik team
 answered on 17 Jan 2014
1 answer
226 views
            <table id="grid">
                <colgroup>
                    <col />
                    <col />
                    <col style="width:110px" />
                    <col style="width:120px" />
                    <col style="width:130px" />
                </colgroup>
                <thead>
                    <tr>
                        <th data-field="make" style="text-align:center;">Car Make</th>
                        <th data-field="model">Car Model</th>
                        <th data-field="year">Year</th>
                        <th data-field="category">Category</th>
                        <th data-field="airconditioner">Air Conditioner</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="table-cell" style="text-align: center; font-size: 14px">Volvo</td>
                        <td>S60</td>
                        <td>2010</td>
                        <td>Saloon</td>
                        <td>Yes</td>
                    </tr>
                    <tr>
                        <td>Audi</td>
                        <td>A4</td>
                        <td>2002</td>
                        <td>Saloon</td>
                        <td>Yes</td>
                    </tr>
                </tbody>
            </table>            
            <script>
                $(document).ready(function() {
                    $("#grid").kendoGrid({
                        sortable: true
                    });
                });
            </script>

 <td class="table-cell" style="text-align: center; font-size: 14px">  application of the central alignment and class, what should I do?
Alexander Popov
Telerik team
 answered on 17 Jan 2014
3 answers
100 views
Is the fixedHeaders (#1) option supported in a listview which is located inside a view which has native scrolling enabled (#2)?

#1 http://docs.kendoui.com/api/mobile/listview#configuration-fixedHeaders
#2 http://docs.kendoui.com/api/mobile/view#configuration-useNativeScrolling

As far as I understand native scrolling doesn't trigger virtual mode on a listview, hence it should work fine.
Kiril Nikolov
Telerik team
 answered on 17 Jan 2014
1 answer
351 views
Hello,

first of all thanks for this amazing framework!
I just have one quick question, because I am using your ListView and I would like to search for more than one field. I was reading through your documentation and it seems like there are a few differences in between the Web API and the Mobile API.

function viewInit(e) {
    e.view.element.find("#listView").kendoMobileListView({
        dataSource: [
            { id: 1, text: "foo" },
            { id: 2, text: "bar" }
        ],
        template: "id: #: id# with text: #: text#",
        filterable: [
            { ignoreCase: true, field: "text" },
            { field: "id" }
        ]
    });
}
This theoretically does not work, does it? Or am I doing anything wrong?
I would appreciate any further help!


Edit:
I know I could just use the operator and "contains" and put all the information in one string, but I was just wondering whether such thing was possible or not.
Kiril Nikolov
Telerik team
 answered on 17 Jan 2014
1 answer
75 views
Hi Kendo Team,

I've a Panel bar in my page, and every panel bar has a grid in it. The problem is when I click on the edit button of the grid in the first panel bar and then the edit button of the grid in the second panel bar, the custom editors just goes haywire. Is it possible to have only one grid in edit mode? If I click in the edit button of the second grid, the edit mode of the first grid is cancelled and vice versa.

Please have a look at the image attached.

Thank you
Niroj
Alexander Popov
Telerik team
 answered on 17 Jan 2014
1 answer
97 views
Hi,

I am new to Kendo Ui web controls.
I have downloaded Kendo Ui complete package.
I have a KendoUi web combobox which i want to bind.I have added a web service page viz. Webservice.asmx, in which i have function that  returns a datatable having 2 columns i.e. DataText column and DataValue column. (which is required for a combobox to bind). But my combobx is not loading at all..please help me on this.
m i on the right track?..OR Is it that i have to return data only in json or xml format? can't we use a datatable?
Please reply soon...its urgent.
I want the app to run on mobile devices.

Thanks,
Shreya
Vladimir Iliev
Telerik team
 answered on 17 Jan 2014
1 answer
398 views
On my web site the numeric textbox is black and the regular textbox is white.  I want both to be white backgroudn and black font.  Does anyone have any suggestions?

HEre is the page.
http://rosatimma.com/classes/Womens-Self-Defense-and-Fitness
Iliana Dyankova
Telerik team
 answered on 17 Jan 2014
3 answers
252 views
I have a kendo grid that must refresh every 2 seconds to show the new rows added to my list of json objects. This is done by datasource.read(). This grid allows filter through the context menu (columnMenu), but the user can't write text in the filter's menu because the grid is reloading every second (datasource.read()).  In other words, when the user inputs some value in the menu's textboxes, the textboxes are cleared after refresh.

Is there any way to avoid to clear the text while the user is writting?
I try to add an "event listener" on the texts boxes to get the its values and fill it after datagrid's reload, but i don't know which column the text box is..  Is there any solution? Here is a demo: http://jsfiddle.net/3qT3J/2/
Thank you.
Kiril Nikolov
Telerik team
 answered on 17 Jan 2014
4 answers
709 views
Hi. I am trying to have the Kendo UI grid select an initial row by ID that I specify. In the following code, grid.select(row) using the data-uid selector does not work. This same code works perfectly fine once the grid is 'up and running'. However, grid.select(row1) using the first row selector DOES work. What is the difference?

I am using Ajax binding if that makes any difference, but the view (page) is initially displayed in response to a HTTP Get MVC action. I also tried initializing in the DataBound event, but same problem.

    $(document).ready(function () {
        // Get a reference to the grid
        var grid = $("#Grid").data("kendoGrid");

        // Select row if specified
        if (dataTypeSelectedGuid) {

            // This snippet does not work - grid.select() returns no rows
            // AND yes, dataTypeSelectedGuid is correct and valid when
            // I look at the HTML.
            var guidRowMatch = "tr[data-uid=" + dataTypeSelectedGuid + "]";
            var row = grid.tbody.find(guidRowMatch);
            grid.select(row);
            var select = grid.select();
            var dataType = grid.dataItem(select);

            // This snippet does work - grid.select() returns first row
            // as expected. What gives? What's the difference?
            var guidRowMatch1 = ">tr:first";
            var row1 = grid.tbody.find(guidRowMatch1);
            grid.select(row1);
            var select1 = grid.select();
            var dataType1 = grid.dataItem(select1);
        }
    });

Jacques
Top achievements
Rank 2
 answered on 17 Jan 2014
1 answer
65 views
I have a listview and details view similar to http://demos.kendoui.com/mobile/listview/editing.html.  I have bound the tap event to the <li> to navigate to the detail view and pass the UID just like in the example. This works perfectly the first time, but when I click the back button and click another row in the listview I get a 404.  

The URL of the list view page is /main.html#transactions.html.  The first time I click a row I navigate successfully to /main.html#view-detail?uid=dc788c65-c7d5-4921-a1a5-8bfc00ad46b3.  Once I click back and click another row, I get /main.html#view-detail?uid=1d8d3baf-204e-4eca-82ed-4c67402b933f (URL seems correct) but the console displays "/view-detail?uid=1d8d3baf-204e-4eca-82ed-4c67402b933f 404 (File not Found)".

Any ideas?
Kiril Nikolov
Telerik team
 answered on 17 Jan 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?