jQWidgets Forums

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: What is "commit" doing ? What is "commit" doing ? #75705

    BenR
    Participant

    In response to my own question … Solution found! (see prior post, above)

    The line of code $("#dataTable").jqxDataTable(

    which should have been $("#dataTable").jqxGrid(

    I was really wanting to work with grid control and not the datable. I think the datatable was copied in from another sample/location, but I did not catch it for some time. The error/success response in the AJAX call was not properly handled in the datatable control, but started working after I changed controls. I also adjusted my MVC controller (and the code above to use a post directive) in order properly utlize the AJAX request in my MVC code. I used the example “CRUD with jqxGrid, ASP.NET MVC3 and SQL“.

    I hope this helps some one else in this obscure issue.

    in reply to: What is "commit" doing ? What is "commit" doing ? #75703

    BenR
    Participant

    Hello JQ widgets Team.

    I am having a similar issue…

    Doing a test with MVC5 and editing a datagrid …

    I am able to display records, when I edit them, the table cell displays the previous value, but if I refresh the screen, it will disply the new value. So I know the value is being written to the database.

    It seems my code related to “updaterow” is having an issue with the AJAX call and ses teh AJAX call as an “error:” rather than a “success”. This is confirmed by “Alert()” code I have injected for debuggin purposes.

    Here is an excerpt of my code …

    
       <script type="text/javascript">
            $(document).ready(function () {
                // prepare the data
                //var data = {};
                var source =
                {
                    dataType: "json",
                    dataFields: [
    
                        { name: 'id', type: 'number' },
                        { name: 'car', type: 'string' },
                        { name: 'title', type: 'string' },
                        { name: 'proj_mgr_id', type: 'string' }
    
                    ],
                    id: 'id',
                    url: '/Project/GetProjects'
                    ,
                    updaterow: function (rowid, rowdata, commit) {
                        // synchronize with the server - send update command
                        data = "update=true" +
                                    "&car="             + rowdata.car +
                                    "&title="           + rowdata.title +
                                    "&proj_mgr_id="     + rowdata.proj_mgr_id +
                                    "&id="              + rowdata.id;
                        //rowdata.id = rowid;
                        $.ajax({
                            dataType: 'json',
                            //cache: false,
                            url: '/Project/UpdateProject',
                            data: rowdata,
                            type: "POST",
                            success: function (data, status, xhr) {
                                // update command is executed.
                                commit(true);
                                //commit(true, data.id);
                                alert('Worked!');
                            },
                            error: function (jqXHR, textStatus, errorThrown) {
                                // update failed.
                                commit(false);
                                alert('Did not work');
                                commit(true);
                            }
                        });
                    }
                }
                var dataAdapter = new $.jqx.dataAdapter(source);
                // create Tree Grid
                $("#dataTable").jqxDataTable(
                {
                    width: 850,
                    source: dataAdapter,
                    theme: 'arctic',
                    editable: true,
                    //editmode: 'selectedcell',
                    pageSize: 5,
                    sortable: true,
                    filterable: true,
                    pageable: true,
                    columns: [
    
                        { text: 'id', dataField: 'id', width: 10 },
                        { text: 'car', dataField: 'car', width: 20 },
                        { text: 'title', dataField: 'title', width: 160 },
                        { text: 'proj_mgr_id', dataField: 'proj_mgr_id', width: 500 } 
                    ]
                });
    
            });
        </script>
    }
    <div id="dataTable">
    </div>
    
    in reply to: Problem with Tabs and IE Problem with Tabs and IE #67430

    BenR
    Participant

    Hello all,

    I had a tab close button this thread helped to resolve. I was seeing duplicate close buttons stacked on one another when dynamically adding tabs using both ‘addlast’ and ‘addfirst’ methods. I added the DOCTYPE reference in my page (in this case my ASP.Net MVC view) at the very top before any razor syntax.

    Here is what I added: <!DOCTYPE html>

    I only had the issue in IE9 ( did not test any other versions of IE)
    Tested in Chrome ver 40.0.xxxxx
    FireFox ver:34.0.5

    Testing jQWidgets v3.5.0

    I hope this help someone else.

Viewing 3 posts - 1 through 3 (of 3 total)