Text to display in mouseovers

I have a column in a grid field which contains large text strings. I want to show first line at first, then on mouse hover users can see full text string. How to achieve it?

  Discussion posts and replies are publicly visible

Parents
  • Hi sudip ,

    As so far as i know , in appian we can't  show full text string on mouse over with in grid field ... But we can put some extra  information column in a grid  with i con .fill that  i con caption as your large text string . When ever user mouse over on the i con it will show your large text string ....

    please find the below code snippet .....

     

    load(
    local!employees: {
            { id: 1, firstName: "Google                       Google LLC is an American multinational technology company that specializes in Internet-related services and products, which include online advertising technologies, search engine, cloud computing, software, and hardware" , lastName: "Smith" , department: "Engineering" , title: "Director" , phoneNumber: "555-123-4567" , startDate: today()-360 },
          { id: 2, firstName: "Yahoo                          Yahoo! is a web services provider headquartered in Sunnyvale, California and owned by Verizon Communications through Oath Inc.. The original Yahoo! company was founded by Jerry Yang and David Filo in January 1994 and was incorporated on March 2, 1995" , lastName: "Johnson" , department: "Finance" , title: "Analyst" , phoneNumber: "555-987-6543" , startDate: today()-360 },
          { id: 3, firstName: "Facebook                       Facebook, Inc. is an American online social media and social networking service company based in Menlo Park, California. Its website was launched on February 4, 2004, by Mark Zuckerberg, along with fellow Harvard College students and roommates Eduardo Saverin, Andrew McCollum, Dustin Moskovitz and Chris Hughes", lastName: "Reed" , department: "Engineering" , title: "Software Engineer" , phoneNumber: "555-456-0123" , startDate: today()-240 },
      },
      a!formLayout(
        label: "Example: Add,Update, or Remove Employee Data",
        contents: {
          a!gridLayout(
            totalCount: count(local!employees),
            headerCells: {
              a!gridLayoutHeaderCell(label: "First Name" ),
                a!gridLayoutHeaderCell(label: "" ),
              a!gridLayoutHeaderCell(label: "Last Name" ),
              a!gridLayoutHeaderCell(label: "Department" ),
              a!gridLayoutHeaderCell(label: "Title" ),
              a!gridLayoutHeaderCell(label: "Phone Number" ),
              a!gridLayoutHeaderCell(label: "Start Date", align: "RIGHT" ),
              /* For the "Remove" column */
              a!gridLayoutHeaderCell(label: "" )
            },
            /* Only needed when some columns need to be narrow */
            columnConfigs: {
              a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
              a!gridLayoutColumnConfig(width: "ICON"),
              a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
              a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
              a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
              a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
              a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:2 ),
              a!gridLayoutColumnConfig(width: "ICON")
            },
            /*
            * a!forEach() will take local!employee data and used that data to loop through an
            * expression that creates each row. 
            *
            * When modifying the recipe to work with your data, you only need to change:
            * 1.) the number of fields in each row
            * 2.) the types of fields for each column (i.e. a!textField() for text data elements)
            * 3.) the fv!item elements. For example fv!item.firstName would change to fv!item.yourdata
            */
            rows: a!forEach(
              items: local!employees,
              expression: a!gridRowLayout(
                contents: {
                  /* For the First Name Column*/
                  a!textField(
                    /* Labels are not visible in grid cells but are necessary to meet accessibility requirements */
                    label: "first name " & fv!index,
                    value: fv!item.firstName,
                    saveInto: fv!item.firstName,
                    required: true,
                    helpTooltip:fv!item.firstName
                  ),
                  /* For the Last Name Column*/
                  a!richTextDisplayField(
                    value: a!richTextIcon(
                      icon:"info-circle",
                      caption: fv!item.firstName
                    )
                  ),
                  a!textField(
                    label: "last name " & fv!index,
                    value: fv!item.lastName,
                    saveInto: fv!item.lastName,
                    required:true
                  ),
                  /* For the Department Column*/
                  a!dropdownField(
                    label: "department " & fv!index,
                    placeholderLabel: "-- Select -- ",
                    choiceLabels: { "Corporate", "Engineering", "Finance", "Human Resources", "Professional Services", "Sales" },
                    choiceValues: { "Corporate", "Engineering", "Finance", "Human Resources", "Professional Services", "Sales" },
                    value: fv!item.department,
                    saveInto: fv!item.department,
                    required:true
                  ),
                  /* For the Title Column*/
                  a!textField(
                    label: "title " & fv!index,
                    value: fv!item.title,
                    saveInto: fv!item.title,
                    required:true
                  ),
                  /* For the Phone Number Column*/
                  a!textField(
                    label: "phone number " & fv!index,
                    placeholder:"555-456-7890",
                    value: fv!item.phoneNumber,
                    saveInto: fv!item.phoneNumber
                  ),
                  /* For the Start Date Column*/
                  a!dateField(
                    label: "start date " & fv!index,
                    value: fv!item.startDate,
                    saveInto: fv!item.startDate,
                    required:true,
                    align: "RIGHT"
                  ),
                  /* For the Removal Column*/
                  a!imageField(
                    label: "delete " & fv!index,
                    images: a!documentImage(
                      document: a!iconIndicator("REMOVE"),
                      altText: "Remove Employee",
                      caption: "Remove " & fv!item.firstName & " " & fv!item.lastName,
                      link: a!dynamicLink(
                        value: fv!index,
                        saveInto: {
                          a!save(local!employees, remove(local!employees, save!value))
                        }
                      )
                    ),
                    size: "ICON"
                  )
                },
                id: fv!index
              )
            ),
            addRowlink: a!dynamicLink(
              label: "Add Employee",
              /*
               * For your use case, set the value to a blank instance of your CDT using
               * the type constructor, e.g. type!Employee(). Only specify the field
               * if you want to give it a default value e.g. startDate: today()+1.
               */
              value: {
                startDate: today() + 1
              },
              saveInto: {
                a!save(local!employees, append(local!employees, save!value))
              }
            )
          )
        },
        buttons: a!buttonLayout(
          primaryButtons: a!buttonWidgetSubmit(
            label: "Submit"
          )
        )
      )
    )

Reply
  • Hi sudip ,

    As so far as i know , in appian we can't  show full text string on mouse over with in grid field ... But we can put some extra  information column in a grid  with i con .fill that  i con caption as your large text string . When ever user mouse over on the i con it will show your large text string ....

    please find the below code snippet .....

     

    load(
    local!employees: {
            { id: 1, firstName: "Google                       Google LLC is an American multinational technology company that specializes in Internet-related services and products, which include online advertising technologies, search engine, cloud computing, software, and hardware" , lastName: "Smith" , department: "Engineering" , title: "Director" , phoneNumber: "555-123-4567" , startDate: today()-360 },
          { id: 2, firstName: "Yahoo                          Yahoo! is a web services provider headquartered in Sunnyvale, California and owned by Verizon Communications through Oath Inc.. The original Yahoo! company was founded by Jerry Yang and David Filo in January 1994 and was incorporated on March 2, 1995" , lastName: "Johnson" , department: "Finance" , title: "Analyst" , phoneNumber: "555-987-6543" , startDate: today()-360 },
          { id: 3, firstName: "Facebook                       Facebook, Inc. is an American online social media and social networking service company based in Menlo Park, California. Its website was launched on February 4, 2004, by Mark Zuckerberg, along with fellow Harvard College students and roommates Eduardo Saverin, Andrew McCollum, Dustin Moskovitz and Chris Hughes", lastName: "Reed" , department: "Engineering" , title: "Software Engineer" , phoneNumber: "555-456-0123" , startDate: today()-240 },
      },
      a!formLayout(
        label: "Example: Add,Update, or Remove Employee Data",
        contents: {
          a!gridLayout(
            totalCount: count(local!employees),
            headerCells: {
              a!gridLayoutHeaderCell(label: "First Name" ),
                a!gridLayoutHeaderCell(label: "" ),
              a!gridLayoutHeaderCell(label: "Last Name" ),
              a!gridLayoutHeaderCell(label: "Department" ),
              a!gridLayoutHeaderCell(label: "Title" ),
              a!gridLayoutHeaderCell(label: "Phone Number" ),
              a!gridLayoutHeaderCell(label: "Start Date", align: "RIGHT" ),
              /* For the "Remove" column */
              a!gridLayoutHeaderCell(label: "" )
            },
            /* Only needed when some columns need to be narrow */
            columnConfigs: {
              a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
              a!gridLayoutColumnConfig(width: "ICON"),
              a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
              a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
              a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
              a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
              a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:2 ),
              a!gridLayoutColumnConfig(width: "ICON")
            },
            /*
            * a!forEach() will take local!employee data and used that data to loop through an
            * expression that creates each row. 
            *
            * When modifying the recipe to work with your data, you only need to change:
            * 1.) the number of fields in each row
            * 2.) the types of fields for each column (i.e. a!textField() for text data elements)
            * 3.) the fv!item elements. For example fv!item.firstName would change to fv!item.yourdata
            */
            rows: a!forEach(
              items: local!employees,
              expression: a!gridRowLayout(
                contents: {
                  /* For the First Name Column*/
                  a!textField(
                    /* Labels are not visible in grid cells but are necessary to meet accessibility requirements */
                    label: "first name " & fv!index,
                    value: fv!item.firstName,
                    saveInto: fv!item.firstName,
                    required: true,
                    helpTooltip:fv!item.firstName
                  ),
                  /* For the Last Name Column*/
                  a!richTextDisplayField(
                    value: a!richTextIcon(
                      icon:"info-circle",
                      caption: fv!item.firstName
                    )
                  ),
                  a!textField(
                    label: "last name " & fv!index,
                    value: fv!item.lastName,
                    saveInto: fv!item.lastName,
                    required:true
                  ),
                  /* For the Department Column*/
                  a!dropdownField(
                    label: "department " & fv!index,
                    placeholderLabel: "-- Select -- ",
                    choiceLabels: { "Corporate", "Engineering", "Finance", "Human Resources", "Professional Services", "Sales" },
                    choiceValues: { "Corporate", "Engineering", "Finance", "Human Resources", "Professional Services", "Sales" },
                    value: fv!item.department,
                    saveInto: fv!item.department,
                    required:true
                  ),
                  /* For the Title Column*/
                  a!textField(
                    label: "title " & fv!index,
                    value: fv!item.title,
                    saveInto: fv!item.title,
                    required:true
                  ),
                  /* For the Phone Number Column*/
                  a!textField(
                    label: "phone number " & fv!index,
                    placeholder:"555-456-7890",
                    value: fv!item.phoneNumber,
                    saveInto: fv!item.phoneNumber
                  ),
                  /* For the Start Date Column*/
                  a!dateField(
                    label: "start date " & fv!index,
                    value: fv!item.startDate,
                    saveInto: fv!item.startDate,
                    required:true,
                    align: "RIGHT"
                  ),
                  /* For the Removal Column*/
                  a!imageField(
                    label: "delete " & fv!index,
                    images: a!documentImage(
                      document: a!iconIndicator("REMOVE"),
                      altText: "Remove Employee",
                      caption: "Remove " & fv!item.firstName & " " & fv!item.lastName,
                      link: a!dynamicLink(
                        value: fv!index,
                        saveInto: {
                          a!save(local!employees, remove(local!employees, save!value))
                        }
                      )
                    ),
                    size: "ICON"
                  )
                },
                id: fv!index
              )
            ),
            addRowlink: a!dynamicLink(
              label: "Add Employee",
              /*
               * For your use case, set the value to a blank instance of your CDT using
               * the type constructor, e.g. type!Employee(). Only specify the field
               * if you want to give it a default value e.g. startDate: today()+1.
               */
              value: {
                startDate: today() + 1
              },
              saveInto: {
                a!save(local!employees, append(local!employees, save!value))
              }
            )
          )
        },
        buttons: a!buttonLayout(
          primaryButtons: a!buttonWidgetSubmit(
            label: "Submit"
          )
        )
      )
    )

Children
No Data