Announcement

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

    Change mouse pointer in ListGrid

    Hello,

    I have a listGrid composed of 2 columns, the first is of type ListGridFieldType.ICON and the second one is a normal string. I would like to change the mouse pointer to the "hand" pointer when the mouse is hovering over the button column in the listGrid. How is this done?

    My code for the listGrid is :
    Code:
     
    ListGridField addButtonField = new ListGridField("instanciate");
    ListGridField listField = new ListGridField("className", "Class Name");
    addButtonField.setType(ListGridFieldType.ICON);
    addButtonField.setCellIcon("resources/images/instanciate_icon.png");
    addButtonField.addRecordClickHandler(new RecordClickHandler() {
      @Override
      public void onRecordClick(RecordClickEvent event) {
        SC.say("you clicked me");
      }
    });
    listGrid.setFields(addButtonField, listField);
    I want the mouse pointer to become a Hand pointer when the mouse is over the addButton

    #2
    No one has an idea?

    Comment


      #3
      I tried a long time ago and would like to know myself.

      I did not see anything obvious to me in the javadoc:
      http://www.smartclient.com/smartgwt/javadoc/

      However, you could try:
      1. Grid Cell Widgets
      You accomplish this by overriding ListGrid.createRecordComponent ()
      The sample has buttons which seems to be exactly what you are looking for:
      http://www.smartclient.com/smartgwt/showcase/#grid_cell_widgets
      BTW, if the contents of your ListGrid can change in the "background", you might also have to override ListGrid.updateRecordComponent ().


      2. Rollover controls
      Similar to #1
      http://www.smartclient.com/smartgwt/showcase/#grid_appearance_rollover_controls

      Comment


        #4
        Thank you for your reply.
        The first link you have provided can indeed be considered a solution.
        The second link you have provided has been removed apparently. I just have one question, ListGrid has a property called setCursor() but why doesn't ListGridField has it too? This would be the best solution for the problem if we could simply do the following:
        Code:
         ListGridField addButtonField = new ListGridField("instanciate");
        addButtonField.setCursor(Cursor.HAND);

        Comment

        Working...
        X