Results 1 to 7 of 7

Thread: Grid.plugin.RowEditing c# function call

  1. #1

    Default Answered: Grid.plugin.RowEditing c# function call

    Hi, am totally new to ExtJs and trying to understand the how to make a function call to c# under plugin.RowEditing. Is it possible?

    Code:
                                        
     xtype: 'gridpanel',
     selType: 'rowmodel',
     plugins: [
                 Ext.create('Ext.grid.plugin.RowEditing', {
                 clicksToEdit: 2,
                 listeners: {
                           'edit': function (editor, e) {
                            e.record.commit();
                            method: 'POST';
                            url: 'ControllerCenter/TestRowEditingCall'; 
                            //is there a way to make a call like above? how to make a function call to C# code
                            //I need to pass as well the e.record data as parameters
                            //editor.store.sync();
                            //var i = e.record.data['FNameDIndex'];
                            //var j = e.newValues['LNameDIndex'];
                              }
                          }
                      })
                   ],
                   height: 200,
                   width: 400,
                   title: '',
                   border: false,
                    store: 'NameDataStore',
                    columns: [
                    {
                             header: 'FName',
                             sortable: true,
                             filterable: true,
                             dataIndex: 'FNameDIndex'
                     },
                     {
                              header: 'LName',
                              sortable: true,
                              filterable: true,
                              dataIndex: 'LNameDIndex'
                     }
    I searched for some incomplete examples online, and all of them were updating the store first, but then? Am really lost, maybe someone could point me out a better way.

  2. Example of using Ajax request to call server side script:
    Code:
    listeners: {
       'edit': function (editor, e) {
            e.record.commit();
            Ext.Ajax.request({
                url   : 'ControllerCenter/TestRowEditingCall',
                method: 'POST',
                params: {
                    ... // get record values and put them here
                },
                ...
            });
          }
    }

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    Is the function web accessible?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #3

    Default

    no, it's not

  5. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    Then you cannot call it.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  6. #5

    Default

    maybe i didn't fully get what you meant. The 'edit' event would be fired through the listener, but in order to save the data, I need to make a c# function call
    1) under the listener
    2) if you could tell me another way?

  7. #6
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347

    Default

    Example of using Ajax request to call server side script:
    Code:
    listeners: {
       'edit': function (editor, e) {
            e.record.commit();
            Ext.Ajax.request({
                url   : 'ControllerCenter/TestRowEditingCall',
                method: 'POST',
                params: {
                    ... // get record values and put them here
                },
                ...
            });
          }
    }

  8. #7

    Default

    thank you vietits, it works~~

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •