Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Listgrid : Drag -> count products

$
0
0
I have to ListGrids :

one with Products :

| Product | Detail |


another were i cant Dropin from the Listgrid above :

Count | Product | Detail |


so if i drop in a Product and its already exist it should do, count+.
So far it count+1 but the dropped in Porduct is shown too;


Code:

@Override
                        public void onRecordDrop(RecordDropEvent event) {
                                // TODO Auto-generated method stub
                                ListGridRecord[] field =new ListGridRecord[111];
                                ListGridRecord[] fieldGrid =new ListGridRecord[111];
                                field = event.getDropRecords();
                               
                                fieldGrid = listGrid.getRecords();
                               
                                for(int i = 0; i < fieldGrid.length; i++){
                               
                               
                                       
                                if(fieldGrid[i].getAttribute("product").equals(field[0].getAttribute("product"))){
                                       
                                        int count=  Integer.parseInt(fieldGrid[i].getAttribute("anzahl")) + 1;
                                       
                                        fieldGrid[i].setAttribute("anzahl", String.valueOf(count));
                                        }
                                }
                               
                               
                        }
                       
                });


Viewing all articles
Browse latest Browse all 4756

Trending Articles