Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How can I use the getSelectedRecord() function in the canEditCell event on listGrid, as in the changed event?

    In the "changed" event, I can use getSelectedRecord() function from the "item" parameter. In this way I can access all data in "comboboxitem" selected record . As in the example below. I have access to the "HesapBaglantiTipi" data.
    "var baglantiTipi = selectedRecord.HesapBaglantiTipi; "
    Code:
    changed: function (form, item, value) {
    
       var selectedRecord = item.getSelectedRecord();
               if (selectedRecord == null)[INDENT]return;
    [/INDENT]
                var baglantiTipi = selectedRecord.HesapBaglantiTipi;                                          [INDENT]if (baglantiTipi = "C")[/INDENT]
                      form.grid.showFields(["CariTipi.CariTipiAdi", "CariKodu.CariAdi", "BelgeTipi.BelgeAdi", "VadeTarihi", "BelgeNumarasi", "BelgeTarihi", "BelgeSeriNo", "YedekAlan12"]);
                     }
    In the "canEditCell" event, how can I access the all data like I accessed with getSelectedRecord () in "ComboboxItem"? I'm trying to do the following example.
    Code:
    canEditCell: function (rowNum, colNum) {
                    var record = this.getEditedRecord(rowNum),
                    fieldName = this.getFieldName(colNum);
                if (fieldName == "CariTipi.CariTipiAdi") {
                    if (!(record && record.HesapPlani && record.HesapPlani.HesapBaglantiTipi != null && (record.HesapPlani.HesapBaglantiTipi === "C" || record.HesapPlani.HesapBaglantiTipi === "CD")))
                        return false;
                    else
                        return true;
    
                }
    
                return this.Super("canEditCell", arguments);            
            },

    #2
    We’re not quite following this question.. you could get the selected record and simply keep it in a variable, of course. But that seems too obvious, so are you asking something else?

    Comment

    Working...
    X