[CLOSED] grid panel - exception on delete row

Page 2 of 2 FirstFirst 12
  1. #11
    but I try your soulution and isNew() returns 'undefined' value
  2. #12
    Could you provide a full sample, please?
  3. #13
    <%@ Page Title="Firme - administracija - Hrvatska" Language="C#" MasterPageFile="~/MasterPages/MP_Base.Master" EnableEventValidation="false" 
        AutoEventWireup="true" CodeBehind="WF_AdminFirma2CRO.aspx.cs" Inherits="WebAppMozzartPromet.Administracija.WF_AdminFirma2CRO" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <asp:Content ID="ContentHead" ContentPlaceHolderID="CPH_Head" runat="server">
    
        <link href="../css/firmaAdmin.css" rel="stylesheet" type="text/css" />
       
        <ext:XScript ID="XScript1" runat="server">
            <script type="text/javascript" language="javascript">
            
                //FILTER BEGIN
                var applyFilter = function (field) {                
                    var store = #{GridPanelKlijent}.getStore(); 
                    store.suspendEvents();
                    store.filterBy(getRecordFilter());                                
                    store.resumeEvents();
                    #{GridPanelKlijent}.getView().refresh(false);
                    #{PagingToolbarKlijent}.bindStore(store, false);
                };
                
                var getRecordFilter = function () {
                    var f = [];
                    
                    
          
                    f.push({
                        filter: function (record) {                         
                            return filterString(#{TextFieldFilterKlijentNaziv}.getValue(), "Klijent_Naziv", record);
                        }
                    });
                    
                    f.push({
                        filter: function (record) {                         
                            return filterString(#{ComboBoxFilterTipKlijenta}.getValue(), "Tip_Naziv", record);
                        }
                    });   
    
                    f.push({
                        filter: function (record) {                         
                            return filterString(#{TextFieldFilterGrad}.getValue(), "Klijent_Grad", record);
                        }
                    }); 
                    
                    f.push({
                        filter: function (record) {                         
                            return filterString(#{TextFieldFilterAdresa}.getValue(), "Klijent_Adresa", record);
                        }
                    }); 
                    
                    f.push({
                        filter: function (record) {                         
                            return filterString(#{TextFieldFilterPIB}.getValue(), "Klijent_PIB", record);
                        }
                    }); 
                    
                    f.push({
                        filter: function (record) {                         
                            return filterString(#{TextFieldFilterMaticniBroj}.getValue(), "Klijent_MaticniBroj", record);
                        }
                    });                                                                              
     
                    var len = f.length;
                     
                    return function (record) {
                        for (var i = 0; i < len; i++) {
                            if (!f[i].filter(record)) {
                                return false;
                            }
                        }
                        return true;
                    };
                };
                
                var filterString = function (value, dataIndex, record) {
                    var val = record.get(dataIndex);
                    
                    if (typeof val != "string") {
                        return value.length == 0;
                    }
                    
                    return val.toLowerCase().indexOf(value.toLowerCase()) > -1;
                };  
                
                var clearFilter = function () {
                    #{TextFieldFilterKlijentNaziv}.reset();  
                    #{ComboBoxFilterTipKlijenta}.reset();
                    #{TextFieldFilterGrad}.reset();
                    #{TextFieldFilterAdresa}.reset();
                    #{TextFieldFilterPIB}.reset();
                    #{TextFieldFilterMaticniBroj}.reset();
                    
                    #{StoreKlijent}.clearFilter();
                }                      
                //FILTER END
                
                //EVENT HANDLER KLIJENT
                var CommandHandlerKlijent_OnClick = function(command, record) {
                    if (command == "ImageCommandUpdateKlijent") { //UPDATE KLIJENT
                        UpdateKlijent(command, record);
                    }
                    else if (command == "ImageCommandDeleteKlijent") { //DELETE KLIJENT          
                        DeleteKlijent(command, record);
                    }
                };
                
                function UpdateKlijent(command, record) { 
                    #{GridPanelKlijent}.body.mask("Ucitavanje ...", "x-mask-loading");
                    NamespaceKlijent.ImageCommandUpdateKlijent_Click(record.data.Klijent_ID);
                }
                
                function DeleteKlijent(command, record) { 
                    Ext.Msg.buttonText.yes = "Da";
                    Ext.Msg.buttonText.no = "Ne";
                    Ext.Msg.show({ 
                        title:'Obri?i firmu?', 
                        msg: 'Da li ste sigurni da ?elite da izbri?ete firmu?', 
                        buttons: Ext.Msg.YESNO, 
                        icon: Ext.MessageBox.QUESTION,
                        fn: function(btn) {
                            if(btn == 'yes') {
                                NamespaceKlijent.ImageCommandDeleteKlijent_Click(record.data.Klijent_ID);  
                            }
                            else if(btn == 'no') {
                                
                            }
                        }
                    });                
                }
                
                //EVENT HANDLER TEKUCI RACUN
                var CommandHandlerTekuciRacun_OnClick = function (command, record) {
                    if (command == "ImageCommandDeleteTekuciRacun") { //DELETE TEKUCI RACUN
                        DeleteTekuciRacun(command, record);
                    }  
                    else if (command == "ImageCommandUpdateTekuciRacun") { // UPDATE TEKUCI RACUN 
                        UpdateTekuciRacun(command, record);
                    }              
                };
                
                function UpdateTekuciRacun(command, record) {
                    if (record.data.TR_ID != -1) {
                        #{TextFieldTekuciRacunUpdateID}.setValue(record.data.TR_ID);
                        #{TextFieldTekuciRacunUpdateTrasat}.setValue(record.data.Trasat);
                        #{TextFieldTekuciRacunUpdatePartija}.setValue(record.data.Partija);
                        #{TextFieldTekuciRacunUpdateNazivTR}.setValue(record.data.TR_Naziv);
                        
                        #{WindowUpdateTekuciRacun}.show();
                    }
                    else { 
    		            Ext.Msg.buttonText.ok = "U redu";
                        Ext.Msg.show({ 
                            title:'Tekuci racun nije unet u bazu', 
                            msg: 'Tekuci racun nije unet u bazu! Prvo sacuvajte podatke.', 
                            buttons: Ext.Msg.OK, 
                            icon: Ext.MessageBox.QUESTION,
                            fn: function(btn) {
                            }
                        });                    
                    }
                }
                
                function ButtonCancelTekuciRacun_Click() {
                        #{TextFieldTekuciRacunUpdateID}.setValue(-1);
                        #{TextFieldTekuciRacunUpdateTrasat}.setValue("");
                        #{TextFieldTekuciRacunUpdatePartija}.setValue("");
                        #{TextFieldTekuciRacunUpdateNazivTR}.setValue("");
                        #{LabelNazivBanke2}.setText("");
                        
                        #{WindowUpdateTekuciRacun}.hide();                
                }            
                
                function DeleteTekuciRacun(command, record) { 
                    if (record.data.TR_ID == -1) {
                        #{StoreTekuciRacuni}.remove(record);
                        #{StoreTekuciRacuni}.commitChanges();
                        #{GridPanelTekuciRacuni}.getView().refresh();
                    }
                    else {
    		            Ext.Msg.buttonText.yes = "Da";
                        Ext.Msg.buttonText.no = "Ne";
                        Ext.Msg.show({ 
                            title:'Obri?i tekuci racun?', 
                            msg: 'Da li ste sigurni da ?elite da izbri?ete tekuci racun?', 
                            buttons: Ext.Msg.YESNO, 
                            icon: Ext.MessageBox.QUESTION,
                            fn: function(btn) {
                                if(btn == 'yes') {
                                    NamespaceTekuciRacun.DeleteTekuciRacun_Click(record.data.TR_ID, #{TextFieldKlijentID}.getValue());                      
                                }
                                else if(btn == 'no') {
                                    
                                }
                            }
                        }); 
                    }
                }                                    
                
                function isFormValid() {
                
                    //Tip klijenta
                    if((#{ComboBoxTipKlijenta}.getText() == #{ComboBoxTipKlijenta}.emptyText) || (#{ComboBoxTipKlijenta}.getText() == "")) {
    		            Ext.Msg.buttonText.ok = "U redu";
                        Ext.Msg.show({ 
                            title:'Tip firme', 
                            msg: 'Morate izabrati tip firme!', 
                            buttons: Ext.Msg.OK, 
                            closable: false,
                            icon: Ext.MessageBox.WARNING,
                            fn: function() {
                                #{ComboBoxTipKlijenta}.focus(true, 5);
                            }
                        });        
                        return false;
                    }    
                    
                    //Naziv
                    if (#{TextFieldKlijentNaziv}.getValue().trim() == "") {
    		            Ext.Msg.buttonText.ok = "U redu";
                        Ext.Msg.show({ 
                            title:'Naziv firme', 
                            msg: 'Morate uneti naziv firme!', 
                            buttons: Ext.Msg.OK, 
                            closable: false,
                            icon: Ext.MessageBox.WARNING,
                            fn: function() {
                                #{TextFieldKlijentNaziv}.focus(true, 5);
                            }
                        });                 
                        return false;       
                    }
                    
                    if (!isValidPIB()) {
                        return false;
                    }                
                    
                    return true;
                }
                
    
                function isValidPIB() {
                    var isValid = false;
                    var dialogType = "alert";
                    var message = "";
    
                    //ajax provera u bazi
                    $.ajax({
                        url: '../service/IsValidPIB.ashx' + '?tfid=' + #{ComboBoxTipKlijenta}.getValue() + '&pib=' + #{TextFieldKlijentPIB}.getValue() + '&kid=' + #{TextFieldKlijentID}.getValue(),
                        dataType: 'json',
                        async: false,
                        success: function(data) {
                            isValid = data.isValid.toLowerCase() == "true";
                            dialogType = data.dialogType;
                            message = data.message;
                        }
                    });
    
                    //dialog
                    if (!isValid) {
                        if (dialogType == "alert") {
    	                    Ext.Msg.buttonText.ok = "U redu";
                            Ext.Msg.show({ 
                                title: 'Firma', 
                                msg: message, 
                                buttons: Ext.Msg.OK, 
                                closable: false,
                                icon: Ext.MessageBox.WARNING
                            });                     
                        }
                        else if (dialogType == "confirm") {
                            isValid = confirm(message);
                        }
                    }
    
                    return isValid;
                }            
                
                var counter = -1;
                
                var ButtonAddTekuciRacun_Click = function() {
                    if (isValidTekuciRacun()) {
                        addTekuciRacunToGridPanel();
                        clearTekuciRacunAdd();
                    }
                };
                
                function isValidTekuciRacun() {
                    
                    //Zakomentarisano pa ce naknadno da se radi provera !!!
                    
                    var tfTrasat = #{TextFieldTrasat};
                    var tfPartija = #{TextFieldPartija};
    
                    if (!ExtNetValidateRequiredField2(tfTrasat, "Morate uneti trasat!", true)) { return false; }
                    if(tfTrasat.getValue().length != 7) { 
    		            Ext.Msg.buttonText.ok = "U redu";
                        Ext.Msg.show({ 
                            title:'Trasat', 
                            msg: 'Broj karaktera za trasat mora biti 7!', 
                            buttons: Ext.Msg.OK, 
                            closable: false,
                            icon: Ext.MessageBox.WARNING
                        });                        
                        return false;
                    }                
                    if (!ExtNetValidateRequiredField2(tfPartija, "Morate uneti partiju!", true)) { return false; }
                    if (!ExtNetRegularExpressionCheck(tfPartija.getValue(), /^[-]?\d+(\.\d+)?$/, "Partija mora da bude broj! Prazni karakteri nisu dozvoljeni!", true)) { return false; }
                    if(tfPartija.getValue().length != 10) { 
    		            Ext.Msg.buttonText.ok = "U redu";
                        Ext.Msg.show({ 
                            title:'Trasat', 
                            msg: 'Broj karaktera za partiju mora biti 10!', 
                            buttons: Ext.Msg.OK, 
                            closable: false,
                            icon: Ext.MessageBox.WARNING
                        });                        
                        return false;
                    }                
                    if (!ajaxIsValidTrasat(tfTrasat, true)){ return false; }
                  
                    if(#{TextFieldNazivRacuna_TR}.getValue().length > 35) { 
    		            Ext.Msg.buttonText.ok = "U redu";
                        Ext.Msg.show({ 
                            title:'Naziv tekuceg racuna', 
                            msg: 'Smanjite broj karaktera u nazivu tekuceg racuna! Maksimalan broj karaktera za naziv tekuceg racuna je 35!', 
                            buttons: Ext.Msg.OK, 
                            closable: false,
                            icon: Ext.MessageBox.WARNING
                        });                        
                        return false;
                    }
    //                
                    if (tekuciRacunExists()) { return false; }
    //                if (false == CanAddTekuciRacun(#{TextFieldTrasat}.getValue(), #{TextFieldPartija}.getValue(), #{TextFieldKontrolniBroj}.getValue(), "Da li ?elite da dodate tekuci racun?")) { return false; }
    //     
                    return true;
                }   
                
                function CanAddTekuciRacun(trasat, partija, kontrolniBroj, questionMessage) {
                    var canAddTR = true;
                    
                    //Lista klijenta za zadati tekuci racun
    	            $.ajax({
    	                url: '../WebServices/WS_Klijent.asmx/GetListKlijentByTR',
    	                contentType: "application/json; charset=utf-8",
    	                type: "POST",
    	                data: "{trasat: " + trasat + ", partija: " + partija + ", kontrolniBroj: " + kontrolniBroj + "}",
    	                dataType: 'json',
    	                async: false,
    	                success: function(response) {
    	                    var list_Klijent = response.d;
    	                    if (list_Klijent != null) {
    	                        var message = "Tekuci racun vec postoji za sledece firme: \n\n";
    	                        $.each(list_Klijent, function(index, klijent) {
    	                            message = message + klijent.Klijent_Naziv + "\n";
    	                        });
    	                        message = message + "\n" + questionMessage; 
    	                        canAddTR = confirm(message);
    	                    }
    	                }
    	            });                
                    
                    return canAddTR;                
                }
                
                function tekuciRacunExists() {
                    var toReturn = false;
                    myStore = #{StoreTekuciRacuni};
                    myStore.data.each(function(item, index, totalItems) {
                        if ((myStore.data.items[index].data["Trasat"] == parseInt(#{TextFieldTrasat}.getValue())) &&
                            (myStore.data.items[index].data["Partija"] == getPartija10(#{TextFieldPartija}))) { 
    		                    Ext.Msg.buttonText.ok = "U redu";
                                Ext.Msg.show({ 
                                    title:'Tekuci racun', 
                                    msg: 'Tekuci racun je vec dodat u listu!', 
                                    buttons: Ext.Msg.OK, 
                                    closable: false,
                                    icon: Ext.MessageBox.WARNING
                                });                             
                                toReturn = true;
                            }
                    });              
                    
                    return toReturn;
                }
                
                //AJAX vraca kontrolni broj
                function getKontrolniBroj(tfTrasat, tfPartija) {
                    var kontrolniBroj = 0;
                    $.ajax({
                        url: '../service/GetKontrolniBroj.ashx' + '?t=' + tfTrasat.getValue() + '&p=' + getPartija10(tfPartija), 
                        dataType: 'json',
                        async: false,
                        success: function(data) {
                            kontrolniBroj = parseInt(data.kBroj);
                        }
                    });
                    
                    return kontrolniBroj;
                }     
                
                function getPartija10(tfPartija) {
                    var partija = tfPartija.getValue();
                    return partija;
    //                var zeroCount = 13 - partija.length;
    //                var adds = "";
    //                for(var i = 0; i < zeroCount; i++){
    //                    adds = adds + "0";
    //                }
    //                var partija13 = adds + partija;
    
    //                return partija13;
                }                            
                
                function clearTekuciRacunAdd() { 
                    #{TextFieldTrasat}.setValue("");
                    #{TextFieldPartija}.setValue("");
                             
                }
                
                function addTekuciRacunToGridPanel() {
                    var myStore = #{StoreTekuciRacuni};
                    counter = counter - 1;
                    var tekuciRacun = { 
                        TR_ID: -1, 
                        Trasat: parseInt(#{TextFieldTrasat}.getValue()), 
                        Partija: getPartija10(#{TextFieldPartija}), 
                        TR_Naziv: #{TextFieldNazivRacuna_TR}.getValue() 
                    };
                    
                    var storeRecord = new myStore.recordType(tekuciRacun, counter); // create new record
                    myStore.add(storeRecord);
                    myStore.commitChanges();
                    
                    #{GridPanelTekuciRacuni}.getView().refresh();            
                }
                
                function TextFieldTrasat_Blur() {
                    if (!ajaxIsValidTrasat(#{TextFieldTrasat}, true)) { }
                }
                
                function TextFieldTekuciRacunUpdateTrasat_Blur() {
                    if (!ajaxIsValidTrasat(#{TextFieldTekuciRacunUpdateTrasat}, false)) { }
                }
                
                function ajaxIsValidTrasat(tfTrasat, toLabel) {
                    var matchArray = tfTrasat.getValue().match(/^[-]?\d+(\.\d+)?$/);
                    if(matchArray == null) { 
                        if(toLabel == true) {
                            #{LabelNazivBanke}.setText("Pogre?an trasat!"); 
                        }
                        else {
                            #{LabelNazivBanke2}.setText("Pogre?an trasat!");
                        }
                        return false;
                    }
                    
                    var banka = "NONE";
                    if (tfTrasat.getValue() != "") {
                        $.ajax({
                            url: '../service/GetBanka.ashx' + '?t=' + tfTrasat.getValue(),
                            dataType: 'json',
                            async: false,
                            success: function(data) {
                                banka = data.banka;
                            }
                        });
                    }
                    
                    if (banka == "NONE") {
                        if (toLabel == true) {
                            #{LabelNazivBanke}.setText("Pogre?an trasat!");
                        }
                        else { 
                            #{LabelNazivBanke2}.setText("Pogre?an trasat!");
                        }
                        return false;
                    }
    
                    if (toLabel == true) {
                        #{LabelNazivBanke}.setText(banka);
                    }
                    else {
                        #{LabelNazivBanke2}.setText(banka);
                    }
                    return true;
                }            
                
                function TextFieldTrasat_Focus() {
                    #{LabelNazivBanke}.setText("");
                }
                
                function TextFieldTekuciRacunUpdateTrasat_Focus() {
                    #{LabelNazivBanke2}.setText("");                
                }
                
                function TextFieldKlijentNaziv_Change() {
                    #{TextFieldNazivRacuna_TR}.setValue(#{TextFieldKlijentNaziv}.getValue());
                }
                
                function isFormTekuciRacunValid() { 
                    
                    //Zakomentarisano pa ce kasnije da se uradi provera !!!
                    
                    var tfTrasat = #{TextFieldTekuciRacunUpdateTrasat};
                    var tfPartija = #{TextFieldTekuciRacunUpdatePartija};
    
    
                    if (!ExtNetValidateRequiredField2(tfTrasat, "Morate uneti trasat!", true)) { return false; }
                    if (!ExtNetValidateRequiredField2(tfPartija, "Morate uneti partiju!", true)) { return false; }
                    if (!ExtNetRegularExpressionCheck(tfPartija.getValue(), /^[-]?\d+(\.\d+)?$/, "Partija mora da bude broj! Prazni karakteri nisu dozvoljeni!", true)) { return false; }
                    if (tfPartija.getValue().length != 10) {
    		            Ext.Msg.buttonText.ok = "U redu";
                        Ext.Msg.show({ 
                            title:'Partija', 
                            msg: 'Partija mora biti du?ine 10 karaktera! Uneli ste ' + tfPartija.getValue().length + ' karaktera.', 
                            buttons: Ext.Msg.OK, 
                            closable: false,
                            icon: Ext.MessageBox.WARNING
                        });                
                        return false;
                    }
                    if (!ajaxIsValidTrasat(tfTrasat, false)){ return false; }
    
    //                var kontrolniBroj = getKontrolniBroj(tfTrasat, tfPartija);
    //                var kbTextBox = parseInt(tfKontrolniBroj.getValue());
    //                
    //                if (kontrolniBroj != kbTextBox) {
    //		            Ext.Msg.buttonText.ok = "U redu";
    //                    Ext.Msg.show({ 
    //                        title:'Tekuci racun', 
    //                        msg: 'Pogre?no unet tekuci racun! Proverite partiju i kontrolni broj!', 
    //                        buttons: Ext.Msg.OK, 
    //                        closable: false,
    //                        icon: Ext.MessageBox.WARNING
    //                    });                
    //                    return false;
    //                } 
    //                
                    if(#{TextFieldTekuciRacunUpdateNazivTR}.getValue().length > 35) { 
    		            Ext.Msg.buttonText.ok = "U redu";
                        Ext.Msg.show({ 
                            title:'Naziv tekuceg racuna', 
                            msg: 'Smanjite broj karaktera u nazivu tekuceg racuna! Maksimalan broj karaktera za naziv tekuceg racuna je 35!', 
                            buttons: Ext.Msg.OK, 
                            closable: false,
                            icon: Ext.MessageBox.WARNING
                        });                        
                        return false;
                    }       
    //                
    //                if (false == CanAddTekuciRacun(tfTrasat.getValue(), tfPartija.getValue(), tfKontrolniBroj.getValue(), "Da li ipak ?elite da sacuvate tekuci racun?")) { return false; }         
    //                             
                    return true;
                }
                
                var prepareCommandHideImage = function (grid, command, record, row) {
                    // you can prepare group command
                    if ((#{HiddenIsAdmin}.getValue() == "NOT_ADMIN")) {
                        command.hidden = true;
                        command.hideMode = 'visibility'; //you can try 'display' also                 
                    }
                };   
                                      
            </script> </ext:XScript>    
            
            
    </asp:Content>
    
    
    <asp:Content ID="ContentBody" ContentPlaceHolderID="CPH_Body" runat="server">
    
        <ext:ResourceManager ID="ResourceManager1" runat="server">
        </ext:ResourceManager>  
                           
        <ext:Hidden ID="HiddenIsAdmin" runat="server">
        </ext:Hidden>
                             
        <ext:Store ID="StoreTipKlijenta" runat="server">
            <Reader>
                <ext:JsonReader IDProperty="TipKlijenta_ID">
                    <Fields>
                        <ext:RecordField Name="TipKlijenta_ID" Type="Int"></ext:RecordField>
                        <ext:RecordField Name="TipKlijenta_Naziv"></ext:RecordField>
                    </Fields>
                </ext:JsonReader>
            </Reader>
        </ext:Store>
                                                    
        <div class="header2">
            Firme 
        </div>
    
        <div class="main_panel">
            <div class="left_panel">
            </div>
            
            <div class="right_panel">
                <ext:GridPanel ID="GridPanelKlijent" runat="server" Header="false" Height="480" Title="Firme" StripeRows="true" TrackMouseOver="true">
                    <Store>
                        <ext:Store ID="StoreKlijent" runat="server" AutoLoad="true">
                            <Reader>
                                <ext:JsonReader IDProperty="Klijent_ID">
                                    <Fields>
                                        <ext:RecordField Name="Klijent_ID" Type="Int"></ext:RecordField>
                                        <ext:RecordField Name="Klijent_Naziv"></ext:RecordField>    
                                        <ext:RecordField Name="Tip_Naziv"></ext:RecordField> 
                                        <ext:RecordField Name="Klijent_Grad"></ext:RecordField>  
                                        <ext:RecordField Name="Klijent_Adresa"></ext:RecordField>  
                                        <ext:RecordField Name="Klijent_PIB"></ext:RecordField>  
                                        <ext:RecordField Name="Klijent_MaticniBroj"></ext:RecordField>  
                                        <ext:RecordField Name="Klijent_KontaktOsoba"></ext:RecordField>  
                                        <ext:RecordField Name="Klijent_Email"></ext:RecordField>  
                                        <ext:RecordField Name="Klijent_WebAdresa"></ext:RecordField>  
                                        <ext:RecordField Name="Klijent_Aktivan"></ext:RecordField>                                                                  
                                    </Fields>
                                </ext:JsonReader>
                            </Reader>
                            <AutoLoadParams>
                                <ext:Parameter Name="start" Value="0" Mode="Raw" />
                                <ext:Parameter Name="limit" Value="50" Mode="Raw"  />
                            </AutoLoadParams>                        
                        </ext:Store>
                    </Store>
                    <ColumnModel ID="ColumnModelKlijent" runat="server">
                        <Columns>
                            <ext:RowNumbererColumn Width="25"></ext:RowNumbererColumn>
                            <ext:Column ColumnID="Klijent_Naziv" DataIndex="Klijent_Naziv" Header="Naziv" Width="200"></ext:Column>
                            <ext:Column ColumnID="Tip_Naziv" DataIndex="Tip_Naziv" Header="Tip klijenta" Width="100"></ext:Column>
                            <ext:Column ColumnID="Klijent_Grad" DataIndex="Klijent_Grad" Header="Grad" Width="90"></ext:Column>
                            <ext:Column ColumnID="Klijent_Adresa" DataIndex="Klijent_Adresa" Header="Adresa" Width="130"></ext:Column>
                            <ext:Column ColumnID="Klijent_PIB" DataIndex="Klijent_PIB" Header="PIB" Width="90"></ext:Column>
                            <ext:Column ColumnID="Klijent_MaticniBroj" DataIndex="Klijent_MaticniBroj" Header="Maticni broj" Width="90"></ext:Column>
                            <ext:Column ColumnID="Klijent_KontaktOsoba" DataIndex="Klijent_KontaktOsoba" Header="Kontakt osoba" Width="70"></ext:Column>
                            <ext:Column ColumnID="Klijent_Email" DataIndex="Klijent_Email" Header="E-mail" Width="100"></ext:Column>
                            <ext:Column ColumnID="Klijent_WebAdresa" DataIndex="Klijent_WebAdresa" Header="Web adresa" Width="100"></ext:Column>
                            <ext:CheckColumn ColumnID="Klijent_Aktivan" DataIndex="Klijent_Aktivan" Header="Aktivna" Sortable="true" Width="50"></ext:CheckColumn>
                            <ext:ImageCommandColumn ColumnID="ImageCommandColumnUpdateKlijent" Width="30">
                                <Commands>
                                    <ext:ImageCommand CommandName="ImageCommandUpdateKlijent" Icon="NoteEdit"></ext:ImageCommand>
                                </Commands>
                            </ext:ImageCommandColumn>
                            <ext:ImageCommandColumn ColumnID="ImageCommandColumnDeleteKlijent" Width="30">
                                <Commands>
                                    <ext:ImageCommand CommandName="ImageCommandDeleteKlijent" Icon="Delete"></ext:ImageCommand>
                                </Commands>
                                <PrepareCommand Fn="prepareCommandHideImage" />
                            </ext:ImageCommandColumn>
                        </Columns>
                    </ColumnModel>
                    <Listeners>
                        <Command Handler="CommandHandlerKlijent_OnClick(command, record)" />
                    </Listeners>                              
                    <View>
                        <ext:GridView ID="GridViewKlijent" runat="server">
                            <HeaderRows>
                                <ext:HeaderRow>
                                    <Columns>
                                        <ext:HeaderColumn AutoWidthElement="false">
                                            <Component>
                                                <ext:Button ID="ButtonClearFilter" runat="server" Icon="Cancel">
                                                    <ToolTips>
                                                        <ext:ToolTip ID="ToolTipClearFilter" runat="server" Html="Poni?ti filter" />
                                                    </ToolTips>
                                                    <Listeners>
                                                        <Click Handler="clearFilter(null);" />
                                                    </Listeners>                                            
                                                </ext:Button>
                                            </Component>
                                        </ext:HeaderColumn>                                     
                                        <ext:HeaderColumn>
                                            <Component>
                                                <ext:TextField ID="TextFieldFilterKlijentNaziv" runat="server" EnableKeyEvents="true">
                                                    <Listeners>
                                                        <KeyUp Handler="applyFilter(this);" Buffer="250" />                                                
                                                    </Listeners>
                                                </ext:TextField>                                    
                                            </Component>
                                        </ext:HeaderColumn>
                                        <ext:HeaderColumn>
                                            <Component>
                                                <ext:ComboBox ID="ComboBoxFilterTipKlijenta" runat="server" StoreID="StoreTipKlijenta" TriggerAction="All" Mode="Local" DisplayField="TipKlijenta_Naziv" ValueField="TipKlijenta_Naziv">
                                                    <Listeners>
                                                        <Select Handler="applyFilter(this);" />
                                                    </Listeners>
                                                </ext:ComboBox>
                                            </Component>
                                        </ext:HeaderColumn>
                                        <ext:HeaderColumn>
                                            <Component>
                                                <ext:TextField ID="TextFieldFilterGrad" runat="server" EnableKeyEvents="true">
                                                    <Listeners>
                                                        <KeyUp Handler="applyFilter(this);" Buffer="250" />                                                
                                                    </Listeners>
                                                </ext:TextField>                                    
                                            </Component>
                                        </ext:HeaderColumn>
                                        <ext:HeaderColumn>
                                            <Component>
                                                <ext:TextField ID="TextFieldFilterAdresa" runat="server" EnableKeyEvents="true">
                                                    <Listeners>
                                                        <KeyUp Handler="applyFilter(this);" Buffer="250" />                                                
                                                    </Listeners>
                                                </ext:TextField>                                    
                                            </Component>
                                        </ext:HeaderColumn>
                                        <ext:HeaderColumn>
                                            <Component>
                                                <ext:TextField ID="TextFieldFilterPIB" runat="server" EnableKeyEvents="true">
                                                    <Listeners>
                                                        <KeyUp Handler="applyFilter(this);" Buffer="250" />                                                
                                                    </Listeners>
                                                </ext:TextField>                                    
                                            </Component>
                                        </ext:HeaderColumn>                                                                                                            
                                        <ext:HeaderColumn>
                                            <Component>
                                                <ext:TextField ID="TextFieldFilterMaticniBroj" runat="server" EnableKeyEvents="true">
                                                    <Listeners>
                                                        <KeyUp Handler="applyFilter(this);" Buffer="250" />                                                
                                                    </Listeners>
                                                </ext:TextField>                                    
                                            </Component>
                                        </ext:HeaderColumn>                                     
                                        <ext:HeaderColumn><Component><ext:Label ID="Label7" runat="server"></ext:Label></Component></ext:HeaderColumn>
                                        <ext:HeaderColumn><Component><ext:Label ID="Label8" runat="server"></ext:Label></Component></ext:HeaderColumn>
                                        <ext:HeaderColumn><Component><ext:Label ID="Label9" runat="server"></ext:Label></Component></ext:HeaderColumn>
                                        <ext:HeaderColumn><Component><ext:Label ID="Label10" runat="server"></ext:Label></Component></ext:HeaderColumn>
                                        <ext:HeaderColumn><Component><ext:Label ID="Label1" runat="server"></ext:Label></Component></ext:HeaderColumn>
                                        <ext:HeaderColumn><Component><ext:Label ID="Label2" runat="server"></ext:Label></Component></ext:HeaderColumn>                                    
                                    </Columns>
                                </ext:HeaderRow>
                            </HeaderRows>
                        </ext:GridView>
                    </View>
                    <LoadMask ShowMask="true" Msg="<%$ Resources:Rsc, Loading %>" />
                    <SelectionModel>
                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true"></ext:RowSelectionModel>
                    </SelectionModel>                
                    <Plugins>
                        <ext:PanelResizer ID="PanelResizerBottom" runat="server" MinHeight="100" />
                    </Plugins> 
                    <BottomBar>
                        <ext:Toolbar ID="ToolbarKlijent" runat="server">
                            <Content>
                                <ext:PagingToolbar ID="PagingToolbarKlijent" runat="server"
                                    PageSize="50"
                                    DisplayInfo="true"
                                    DisplayMsg="Prikazano {0} - {1} od {2}"
                                    StoreID="StoreKlijent"
                                    BeforePageText="Strana"
                                    PrevText="Prethodna"
                                    NextText="Sledeca"
                                    FirstText="Prva"
                                    LastText="Poslednja"
                                    HideRefresh="true"
                                    EmptyMsg="Nema rezultata">
                                </ext:PagingToolbar>                             
                            </Content>   
                            <Items>
                                <ext:ToolbarFill ID="ToolbarFillKlijent" runat="server"></ext:ToolbarFill>
                                <ext:Button ID="ButtonInsertKlijent" runat="server" Text="Nova firma" Icon="NoteAdd">
                                    <DirectEvents>
                                        <Click OnEvent="ButtonInsertKlijent_DirectClick">
                                            <EventMask ShowMask="true" Target="Page" Msg="<%$ Resources:Rsc, Loading %>" />                                      
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                            </Items>                                             
                        </ext:Toolbar>
                    </BottomBar>         
                </ext:GridPanel>
                
                <ext:Window ID="WindowKlijent" runat="server" 
                    Hidden="true"
                    Collapsible="false"
                    Closable="false"
                    Header="false"
                    Modal="true"
                    Resizable="true"
                    Padding="0"
                    Height="295"
                    Width="910">
                    <Listeners>
                        <Show Handler="#{GridPanelKlijent}.body.unmask();" />
                    </Listeners>                
                    <Content>
                        <div class="float-left">
                            <ext:FormPanel 
                                ID="FormPanelKlijent" 
                                runat="server" 
                                Split="true"
                                Margins="0 5 5 5"
                                Frame="true" 
                                Header="false"
                                Width="400"
                                DefaultAnchor="100%">
                                <Items>
                                    <ext:TextField ID="TextFieldKlijentID" runat="server" FieldLabel="ID" LabelAlign="Left" LabelWidth="100" Width="200" Disabled="true"></ext:TextField>                                 
                                    <ext:ComboBox ID="ComboBoxTipKlijenta" runat="server" StoreID="StoreTipKlijenta" ValueField="TipKlijenta_ID" DisplayField="TipKlijenta_Naziv" EmptyText="Izaberite tip firme" Editable="false" FieldLabel="Tip" LabelAlign="Left" LabelWidth="100" Width="300"></ext:ComboBox>
                                    <ext:TextField ID="TextFieldKlijentNaziv" runat="server" FieldLabel="Naziv" LabelAlign="Left" LabelWidth="100" Width="300">
                                        <Listeners>
                                            <Change Handler="TextFieldKlijentNaziv_Change();" />
                                        </Listeners>
                                    </ext:TextField>
                                    <ext:TextField ID="TextFieldKlijentGrad" runat="server" FieldLabel="Grad" LabelAlign="Left" LabelWidth="100" Width="300"></ext:TextField>
                                    <ext:TextField ID="TextFieldKlijentAdresa" runat="server" FieldLabel="Adresa" LabelAlign="Left" LabelWidth="100" Width="300"></ext:TextField>
                                    <ext:TextField ID="TextFieldKlijentPIB" runat="server" FieldLabel="PIB" LabelAlign="Left" LabelWidth="100" Width="300"></ext:TextField>
                                    <ext:TextField ID="TextFieldKlijentMaticniBroj" runat="server" FieldLabel="Maticni broj" LabelAlign="Left" LabelWidth="100" Width="300"></ext:TextField>
                                    <ext:TextField ID="TextFieldKlijentKontaktOsoba" runat="server" FieldLabel="Kontakt osoba" LabelAlign="Left" LabelWidth="100" Width="300"></ext:TextField>
                                    <ext:TextField ID="TextFieldKlijentEmail" runat="server" FieldLabel="E-mail" LabelAlign="Left" LabelWidth="100" Width="300"></ext:TextField>
                                    <ext:TextField ID="TextFieldKlijentWebAdresa" runat="server" FieldLabel="Web adresa" LabelAlign="Left" LabelWidth="100" Width="300"></ext:TextField>
                                    <ext:Checkbox ID="CheckboxKlijentAktivan" runat="server" FieldLabel="Aktivna" LabelAlign="Left" LabelWidth="100"></ext:Checkbox>                          
                                </Items>
                            </ext:FormPanel>                                          
                        </div>
                        <div class="float-left">
                            <ext:GridPanel ID="GridPanelTekuciRacuni" runat="server" Header="false" Title="Tekuci racuni" Height="250" StripeRows="true" TrackMouseOver="true">
                                <Store>
                                    <ext:Store ID="StoreTekuciRacuni" runat="server">
                                        <Reader>
                                            <ext:JsonReader IDProperty="TR_ID">
                                                <Fields>
                                                    <ext:RecordField Name="TR_ID" Type="Int"></ext:RecordField>
                                                    <ext:RecordField Name="Trasat" Type="Int"></ext:RecordField>
                                                    <ext:RecordField Name="Partija"></ext:RecordField>
                                                    <ext:RecordField Name="TR_Naziv"></ext:RecordField>
                                                </Fields>
                                            </ext:JsonReader>
                                        </Reader>
                                    </ext:Store>
                                </Store>
                                <TopBar>
                                    <ext:Toolbar ID="ToolbarTop1" runat="server">
                                        <Content>
                                            <div>
                                                &nbsp;
                                                <ext:Label ID="LabelNazivBanke" runat="server" Text=" "></ext:Label>
                                            </div>
                                        </Content>
                                    </ext:Toolbar>
                                </TopBar>
                                <ColumnModel ID="ColumnModelTekuciRacun">
                                    <Columns>
                                        <ext:Column ColumnID="Trasat" DataIndex="Trasat" Header="Trasat" Width="65"></ext:Column>
                                        <ext:Column ColumnID="Partija" DataIndex="Partija" Header="Partija" Width="100"></ext:Column>
                                        <ext:Column ColumnID="TR_Naziv" DataIndex="TR_Naziv" Header="Naziv racuna" Width="200"></ext:Column>
                                        <ext:ImageCommandColumn ColumnID="ImageCommandColumnDeleteTekuciRacun" Width="30">
                                            <Commands>
                                                <ext:ImageCommand CommandName="ImageCommandDeleteTekuciRacun" Icon="Delete"></ext:ImageCommand>
                                            </Commands>
                                            <PrepareCommand Fn="prepareCommandHideImage" />
                                        </ext:ImageCommandColumn>
                                        <ext:ImageCommandColumn ColumnID="ImageCommandColumnUpdateTekiciRacun" Width="30">
                                            <Commands>
                                                <ext:ImageCommand CommandName="ImageCommandUpdateTekuciRacun" Icon="NoteEdit"></ext:ImageCommand>
                                            </Commands>
                                            <PrepareCommand Fn="prepareCommandHideImage" />
                                        </ext:ImageCommandColumn>
                                    </Columns>
                                </ColumnModel>
                                <Listeners>
                                    <Command Handler="CommandHandlerTekuciRacun_OnClick(command, record)" />
                                </Listeners> 
                                <SelectionModel>
                                    <ext:RowSelectionModel ID="RowSelectionModel2" runat="server" SingleSelect="true"></ext:RowSelectionModel>
                                </SelectionModel>   
                                <Plugins>
                                    <ext:PanelResizer ID="PanelResizer1" runat="server" MinHeight="100" />
                                </Plugins>
                                <View>
                                    <ext:GridView ID="GridViewTekuciRacuni" runat="server">
                                        <HeaderRows>
                                            <ext:HeaderRow>
                                                <Columns>
                                                    <ext:HeaderColumn>
                                                        <Component>
                                                            <ext:TextField ID="TextFieldTrasat" runat="server">
                                                                <Listeners>
                                                                    <Blur Handler="TextFieldTrasat_Blur();" />
                                                                    <Focus Handler="TextFieldTrasat_Focus();" />
                                                                </Listeners>
                                                            </ext:TextField>
                                                        </Component>
                                                    </ext:HeaderColumn>
                                                    <ext:HeaderColumn>
                                                        <Component>
                                                            <ext:TextField ID="TextFieldPartija" runat="server"></ext:TextField>
                                                        </Component>
                                                    </ext:HeaderColumn>
                                                    <ext:HeaderColumn>
                                                        <Component>
                                                            <ext:TextField ID="TextFieldNazivRacuna_TR" runat="server"></ext:TextField>
                                                        </Component>
                                                    </ext:HeaderColumn>                                                
                                                    <ext:HeaderColumn>
                                                        <Component>
                                                            <ext:Button ID="ButtonAddTekuciRacun" runat="server" Icon="Add">
                                                                <Listeners>
                                                                    <Click Handler="ButtonAddTekuciRacun_Click();" />
                                                                </Listeners>
                                                            </ext:Button>
                                                        </Component>
                                                    </ext:HeaderColumn>  
                                                    <ext:HeaderColumn><Component><ext:Label ID="Label12" runat="server"></ext:Label></Component></ext:HeaderColumn>                                                                                                                                                                                                                                             
                                                </Columns>
                                            </ext:HeaderRow>
                                            
                                        </HeaderRows>
                                    </ext:GridView>
                                </View>                                                                              
                            </ext:GridPanel>
                        </div>
                        <div class="clear"></div>
                        
                        <div>
                            <ext:Toolbar ID="ToolbarKlijentWindow" runat="server">
                                <Items>
                                    <ext:ToolbarFill ID="ToolbarFill1" runat="server"></ext:ToolbarFill>
                                    <ext:Button ID="ButtonSave" runat="server" Text="Sacuvaj" Icon="DatabaseSave">
                                        <DirectEvents>
                                            <Click OnEvent="ButtonSave_DirectClick">
                                                <EventMask ShowMask="true" Target="Page" Msg="<%$ Resources:Rsc, Loading %>" />
                                                <ExtraParams>
                                                    <ext:Parameter Name="pTekuciRacuni" Value="Ext.encode(#{GridPanelTekuciRacuni}.getRowsValues({selectedOnly : false}))" Mode="Raw" />
                                                </ExtraParams> 
                                            </Click>                                       
                                        </DirectEvents> 
                                        <Listeners>
                                            <Click Handler="return isFormValid();" />
                                        </Listeners>                                                                
                                    </ext:Button>                                                        
                                    <ext:Button ID="ButtonCancelSave" runat="server" Text="Odustani" Icon="Cancel">
                                        <DirectEvents>
                                            <Click OnEvent="ButtonCancelSave_DirectClick">
                                                <EventMask ShowMask="true" Target="Page" Msg="<%$ Resources:Rsc, Loading %>" />
                                            </Click>
                                        </DirectEvents>                             
                                    </ext:Button>                                                    
                                </Items>
                            </ext:Toolbar>
                        </div>                    
                    </Content>
                </ext:Window>
                
                <ext:Window ID="WindowUpdateTekuciRacun" runat="server"
                    Hidden="true"
                    Collapsible="false"
                    Closable="false"
                    Header="false"
                    Modal="true"
                    Resizable="true"
                    Padding="0"
                    Width="400"
                    Height="195">                
                    <Content>
                        <ext:FormPanel ID="FormPanelTekuciRacun" runat="server"
                            Split="true"
                            Margins="0 5 5 5"
                            Frame="true"
                            Header="false"
                            Width="400"
                            Height="150"
                            DefaultAnchor="100%">
                            <Items>
                                <ext:TextField ID="TextFieldTekuciRacunUpdateID" runat="server" FieldLabel="ID" LabelAlign="Left" LabelWidth="100" Width="300" Disabled="true"></ext:TextField>                                                             
                                <ext:TextField ID="TextFieldTekuciRacunUpdateTrasat" runat="server" FieldLabel="Trasat" LabelAlign="Left" LabelWidth="100" Width="300" Disabled="false">
                                    <Listeners>
                                        <Blur Handler="TextFieldTekuciRacunUpdateTrasat_Blur();" />
                                        <Focus Handler="TextFieldTekuciRacunUpdateTrasat_Focus();" />                                
                                    </Listeners>                            
                                </ext:TextField>                                                             
                                <ext:TextField ID="TextFieldTekuciRacunUpdatePartija" runat="server" FieldLabel="Partija" LabelAlign="Left" LabelWidth="100" Width="300" Disabled="false"></ext:TextField>                                                             
                                <ext:TextField ID="TextFieldTekuciRacunUpdateNazivTR" runat="server" FieldLabel="Naziv" LabelAlign="Left" LabelWidth="100" Width="300" Disabled="false"></ext:TextField>                                                             
                                <ext:Label ID="LabelNazivBanke2" runat="server" Width="300"></ext:Label>
                            </Items>
                        </ext:FormPanel>
                        <ext:Toolbar ID="ToolbarUpdateTR" runat="server">
                            <Items>
                                <ext:ToolbarFill ID="ToolbarFill2" runat="server"></ext:ToolbarFill>
                                <ext:Button ID="ButtonSaveTekuciRacun" runat="server" Text="Sacuvaj" Icon="DatabaseSave">
                                    <DirectEvents>
                                        <Click OnEvent="ButtonSaveTekuciRacun_DirectClick">
                                            <EventMask ShowMask="true" Target="Page" Msg="<%$ Resources:Rsc, Loading %>" />
                                        </Click>
                                    </DirectEvents>
                                    <Listeners>
                                        <Click Handler="return isFormTekuciRacunValid();" />
                                    </Listeners>
                                </ext:Button>
                                <ext:Button ID="ButtonCancelTekuciRacun" runat="server" Text="Odustani" Icon="Cancel">
                                    <Listeners>
                                        <Click Handler="ButtonCancelTekuciRacun_Click();" />
                                    </Listeners>
                                </ext:Button>                            
                            </Items>
                        </ext:Toolbar>
                    </Content>
                </ext:Window>            
            </div>     
        </div>   
        
    </asp:Content>
  4. #14
    I see a lot of things which, I think, are not required to reproduce the problem.

    As well, a MasterPage and code behind are missed.

    Please use the following technique to simplify the code.
    How to reduce a sample

    NOTE: Marking as closed. Please feel free to update the thread with a sample to reproduce the problem.
    Last edited by Daniil; Nov 02, 2011 at 5:07 PM.
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Ext.Net 2.0 Delete from Grid in C#
    By OSSAGHO in forum 2.x Help
    Replies: 0
    Last Post: Aug 08, 2012, 2:05 PM
  2. [CLOSED] Adding panels to a tab panel throws exception
    By RCM in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Mar 09, 2012, 7:28 PM
  3. Replies: 4
    Last Post: Aug 09, 2010, 4:12 PM
  4. [CLOSED] Exception when grid contains no rows
    By alexp in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 18, 2009, 10:37 AM
  5. Problem with Delete Command and Grid Panel
    By jpmcm88 in forum 1.x Help
    Replies: 2
    Last Post: Jul 20, 2009, 2:02 PM

Tags for this Thread

Posting Permissions