Announcement

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

    while adding new row into list grid how to scroll extended row using smart gwt 12.0. I could only screen view area while adding row into listgrid after that I couldn't see extended row while adding

    while adding row into list grid I couldn't see extended row height to be scrollable , after adding the record I could see the record but while adding the record vertical scrollbar is not coming down automatically instead of that it is scrolling upwards.

    I am calling scrollToRow(totalRow-1) in DataArrived Handler. But the scrollbar is not coming down. User need to scroll down manually. This is the code I am using to scroll down


    donationGrid.addDataArrivedHandler(new DataArrivedHandler() {
    @Override
    public void onDataArrived(final DataArrivedEvent event) {
    updateHeadingValues();

    final int totalRows = donationGrid.getTotalRows();
    if (isCashierMode && !isAllocateMode) {
    setDefaults(totalRows);
    donationGrid.startEditing(totalRows, donationGrid.getFieldNum(DonationDS.DONATIONTYPE), false);
    } else {
    if (totalRows > 0) {
    donationGrid.selectRecord(totalRows-1);

    donationGrid.scrollToRow(totalRows-1);


    } else {
    donationMediator.focusAddDonationButton();
    }
    }
    }
    });








    #2
    We document that the dataArrived handler isn't run for adds. You should instead run your logic in the dataChanged
    handler
    . If making that change doesn't solve your problem, please provide us with a complete, runnable sample, or at least a video capture of the problem you're having.

    Comment


      #3
      Hi Isomorphic,

      Thank you so much for your reply. I tried your suggestion. But is is not working I moved all my code to dataChangedHandler. But the listgrid is not scrolling to end of the row. Using dataChangedhandler I could bring the focus to current editing row. But vertical scrollbar is scrolling automatically while adding the record. Once the record adding completed then only it is scrolling bottom to the page.


      Here I am posting my code. This small description about my task.

      I have DonationGridPand. On that I have DonationGrid. I am adding the donations by clicking add Donation button. While adding the donations into Donation Grid until screen view vertical scroll bar is scrolling down. After User has to scroll manually while adding the record. Here is scenatio

      1. After I press tab in the last column it will open one popup, then enter data into that popup and say save then it will come back to Donation Grid again.
      2. Here the current which I am editing is extended record. So the vertical scrollbar is not scrolling down automatically until User say done on the extended record. But to click on Done, User has to scroll down manually. Here I attached screen shots for all of them first one is while adding record, second screen shot show when tab last column open popup. Then once I click save on popup, then it will come back to DonationGrid. Here we will see Extended, here I have problem vertical scrollbar is scroll down automatically.

      This is my code

      donationGrid.addDataChangedHandler(new DataChangedHandler() {
      @Override
      public void onDataChanged(final DataChangedEvent event) {

      updateHeadingValues();

      final int totalRows = donationGrid.getTotalRows();
      if (isCashierMode && !isAllocateMode) {
      setDefaults(totalRows);
      donationGrid.startEditing(totalRows, donationGrid.getFieldNum(DonationDS.DONATIONTYPE), false);
      } else {
      if (totalRows > 0) {
      donationGrid.selectRecord(totalRows-1);
      //donationGrid.selectRecord(totalRows);

      //donationGrid.scrollToRow(totalRows-1);
      //donationGrid.getScrollBottom();
      //donationGrid.scrollToRow(totalRows);
      donationGrid.scrollToRow(totalRows-1, VerticalAlignment.BOTTOM);
      //donationGrid.scrollToRow(totalRows+1, VerticalAlignment.BOTTOM);

      }
      Last edited by Rama1; 7th Apr 2020, 09:38.

      Comment


        #4
        This is a massive amount of code unrelated to the claimed problem, and also all formatting was somehow lost (remember to use CODE tags).

        If you think this is a framework issue, we need a minimal test case showing scrollToRow() not operating as expected after an "add" operation triggers DataChanged, but note, we have already tested the combination of DataChanged and scrollToRow() by just adding minimal code to one of our samples, and it works as expected.

        You'll need to isolate whatever is different about your code, and if it still appears to be a framework bug, let us know.

        Make sure also that you have tested against the latest available patch build (see smartclient.com/builds).

        Comment


          #5
          Hi Isomorphic,

          Thank you so much for your reply. Sorry I posted lot of code by mistake. Now I adjusted my code where I got problem. Ok I will test again and let you know. Still If doesn't work I will post test case.


          Thank you
          Rama

          Comment

          Working...
          X