Skip to content
Related Articles

Related Articles

jQWidgets jqxTextArea displayMember Property

View Discussion
Improve Article
Save Article
  • Last Updated : 23 May, 2022
View Discussion
Improve Article
Save Article

jQWidgets is a JavaScript framework for making web-based applications for PC and mobile devices. It is a very powerful, optimized, platform-independent, and widely supported framework. The jqxTextArea represents a jQuery Text area widget that is used to insert text content inside the textbox.

The displayMember Property is used to set or return the displayMember of the Items in the jQWidgets. It represents the name of an object property that is to be displayed. The name is specified by the ‘source’ property that is contained in the collection. It accepts String type values and its default value is empty .

Syntax:

  • Set the displayMember property:
$("Selector").jqxTextArea({ displayMember: 'firstName' });
  • Return the valueMember property:
var dm = $('Selector').jqxTextArea('displayMember');

Linked Files: Download jQWidgets from the given link. In the HTML file, locate the script files in the downloaded folder.

<link rel=”stylesheet” href=”jqwidgets/styles/jqx.base.css” type=”text/css” />
<script type=”text/javascript” src=”scripts/jquery-1.11.1.min.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxbuttons.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxscrollbar.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxtextarea.js”></script>

Example: The below example illustrates the jqxTextArea displayMember Property in jQWidgets.

HTML




<!DOCTYPE html>
<html lang="en">
  
<head>
    <link rel="stylesheet" href=
        "jqwidgets/styles/jqx.base.css" 
          type="text/css" />
    <script type="text/javascript" 
            src="scripts/jquery-1.11.1.min.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxcore.js">
      </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxbuttons.js">
      </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxscrollbar.js">
      </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxtextarea.js">
      </script>
</head>
  
<body>
    <center>
        <h1 style="color: green;">
            GeeksforGeeks
        </h1>
        <h3>
            jQWidgets jqxTextArea displayMember Property
        </h3>
        <textarea id='jqxTA'></textarea>
    </center>
  
    <script type="text/javascript">
        $(document).ready(function () {
            var data = [{
                "id": 1,
                "name": "Akash",
                "address": "Noida"
            },
            {
                "id": 2,
                "name": "Deepak",
                "address": "Noida"
            },
            {
                "id": 3,
                "name": "Rakesh",
                "address": "Delhi"
            },
            {
                "id": 4,
                "name": "Adarsh",
                "address": "Delhi"
            },
            {
                "id": 5,
                "name": "Arun",
                "address": "Noida"
            },];
  
            $('#jqxTA').jqxTextArea({
                source: data,
                placeHolder: "Name:",
                displayMember: "name",
                valueMember: "address",
                width: 250,
                height: 100,
                placeHolder: 'Enter Name...'
            });
        });
    </script>
</body>
</html>


Output:

 

Reference: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxtextarea/jquery-textarea-api.htm


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!