kayhan Posted October 11, 2020 Share Posted October 11, 2020 Merhaba, Listede gösterilen satırların durumuna göre renklenmesini istiyorum. Sitede baya bir örnek inceledim sonuç olarak aşağıdaki gibi bir kodlama yaptım. Enteresan bir şekilde kodladığım değil de kodlamadığım renklerin görünüyor olması. Örneğin: "Fiyat bekliyor" olanlar için gold rengini belirtmişim ama ekranda siyah renkle boyanmış görüyorum. "Fiyatlar gönderildi" olanları green belirtmişim ama kırmızı görünüyor :-) :-) Ne iştir anlamadım. Yardımlarınızı rica ediyorum. Teşekkür ederim. Unigui versiyonu: 1.90.0.1536 Delphi versiyonu: 10.4.1 UnimDBListGrid > unievents > function beforeInit(sender, config) { config.loadingText='Yükleniyor...'; config.grouped=true; config.selectedCls=''; var htmlRow='<table style="width:100%;white-space: nowrap;vertical-aling:middle;">'+ '<tr>'+ '<td style="color:#3a6383;padding-left:5px;" colspan="2"><b>{3} - {0}</b> / {4}</td>'+ '</tr>'+ '<tr>'+ '<td style="font-size:15px;padding-top:4px;padding-left:5px;color:#535454;">Müşteri: <b>{1}</b> - {5}</td>'+ '</tr>'+ '<tr bgcolor={[this.getColor(values)]};>'+ '<td style="font-size:15px;padding-top:4px;padding-left:5px;color:#535454;">{2}</td>'+ '</tr>'+ '</table>'; config.itemTpl= new Ext.XTemplate( htmlRow, { getColor: function(values) { if(values[2] == 'Fiyatlar gönderildi') { return 'green'; } else if(values[2] == 'Fiyat bekliyor') { return 'gold'; } else if(values[2] == 'iptal') { return 'red'; } else { return 'white'; } } } ); config.forceFit = true; } Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 11, 2020 Share Posted October 11, 2020 8 minutes ago, kayhan said: Enteresan bir şekilde kodladığım değil de kodlamadığım renklerin görünüyor olması. Örneğin: "Fiyat bekliyor" olanlar için gold rengini belirtmişim ama ekranda siyah renkle boyanmış görüyorum. "Fiyatlar gönderildi" olanları green belirtmişim ama kırmızı görünüyor :-) :-) Merhaba, Can you make a simple testcase to check? Quote Link to comment Share on other sites More sharing options...
kayhan Posted October 11, 2020 Author Share Posted October 11, 2020 18 minutes ago, Sherzod said: Merhaba, Can you make a simple testcase to check? unimdblistgrid_test.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 11, 2020 Share Posted October 11, 2020 11 minutes ago, kayhan said: unimdblistgrid_test.zip 2.43 MB · 0 downloads Try this '<tr bgcolor={[this.getColor(values)]}>'+ instead of '<tr bgcolor={[this.getColor(values)]};>'+ 1 Quote Link to comment Share on other sites More sharing options...
kayhan Posted October 11, 2020 Author Share Posted October 11, 2020 7 minutes ago, Sherzod said: Try this '<tr bgcolor={[this.getColor(values)]}>'+ instead of '<tr bgcolor={[this.getColor(values)]};>'+ Yes it works fine :-) Thank you so much. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.