Photoshop Practical shortcut key

2023-01-22   ES  

MODEL class is as follows:

  public class UserStore
    {
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string EmailAddress { get; set; }
    }

Controller class is as follows:

 public class GridController : Controller
    { 
        public ActionResult Index()
        {
            var list = new List<UserStore>(); 
            list.Add(new UserStore() { EmailAddress = "[email protected]", FirstName = "Rose", LastName = "Taylor"});
            list.Add(new UserStore() { EmailAddress = "[email protected]", FirstName = "Russell", LastName = "Nguyen" });
            list.Add(new UserStore() { EmailAddress = "[email protected]", FirstName = "Ellis", LastName = "Davis" });
            list.Add(new UserStore() { EmailAddress = "[email protected]", FirstName = "Neal", LastName = "Clarke" });
            list.Add(new UserStore() { EmailAddress = "[email protected]", FirstName = "Brendon", LastName = "Taylor" });

            ViewBag.userStore = JsonConvert.SerializeObject(list);
            return View();
        }

    }

sendex.cshtml content is as follows:

@{
    ViewBag.Title = "Index";
}

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Grid Demo</title>
    <link rel="stylesheet" type="text/css" href="http://cdn.bootcss.com/extjs/6.0.1/classic/theme-neptune/resources/theme-neptune-all.css">
    <script type="text/javascript" src="http://cdn.bootcss.com/extjs/6.0.1/ext-all.js"></script>
    <script type="text/javascript" src="http://cdn.bootcss.com/extjs/6.0.1/classic/theme-neptune/theme-neptune.js"></script>
    <script type="text/javascript">
        var userList = '@(Html.Raw(ViewBag.userStore))';
    </script>
    <script type="text/javascript" src="~/Scripts/grid.js"></script>
</head>
<body>
</body>

</html>

grid.js code:

EXT.DEFINE ('UserList', { 
     extend: 'ext.data.model', 
     Fields: ['firstName', 'LastName', 'Emailaddress'] // You Can Comment the Fields. It Still Works. 
 }); 

 var usestore = ext.create ('ext.data.store', { 
     Model: 'UserList', 
     data: ext.json.decode (userlist) 
 }); 

 // Define pagination 
 var pagebar = ext.create ("ext.toolbar.paging", {{ 
     Store: usestore, 
     displayinfo: true, 
     displaymsg: "Display {0}-{1} bar, total {2}", 
     EMPTYMSG: "No data" 

 }); 

 Ext.application ({{{ 
     name: 'EXT6 GRID Example', 
     Launch: Function () { 
         Ext.create ('EXT.Grid.panel', { 
             renderto: ext.getBody (), 
             Seltype: 'Rowmodel', // 'Cellmodel', 
             plugins: [{{ 
                 ptype: 'rowediting', 
                 ClickStoEdit: 1 
             }],,, 
             Store: usestore, 
             columnlines: true, 
             // width: "100%", 
             // frame: true, 
             Forcefit: true, 
             fixed: true, 
             height: 500, 
             Title: 'EXT6 GRID Example', 
           
           Columns: [ 
                 {{ 
                     text: 'first name', 
                     width: 200, 
                     dataindex: 'firstname', 
                     Editor: 'TextField' 
                 }, 
                 {{ 
                     text: 'last name', 
                     width: 200, 
                     dataindex: 'LastName', 
                     Editor: 'TextField' 
                 }, 
                 {{ 
                     text: 'email address', 
                     width: 250, 
                     dataindex: 'emailaddress', 
                     Editor: {{ 
                         XType: 'TextField', 
                         AllowBlank: false 
                     } 
                 }, 
                  {{ 
                      Text: 'BIRTH DATE', 
                      width: 250, 
                      dataindex: 'BIRTHDATE', 
                      Editor: 'Datefield' 
                  } 
             ],,, 
             // Pagling function 
             // bbar: PageBar, 
             // Pagling function-Effects are the same as above 
             dockedItems: [{{ 
                 xtype: 'pagingtoolbar', 
                 Store: usestore, 
                 Dock: 'Bottom', 
                 displayinfo: true, 
             }] 
         }); 

     } 
 });

display page as shown in the figure:

source

Related Posts

queue — chain storage

CALENDAR class DATE Class Converting to each other

Multi-thread programming-1 1/condition variable/level use example

java web development from getting started?

Photoshop Practical shortcut key

Random Posts

Introduction to use Visual Studio 2010 expansion kit: NUGET kit administrator

Ant Design Pro 2.0 Call the background interface data

Leetcode Question: Tencent Selection Exercise 50 Questions 231.2 Power

Learning to move SF tags: XSLT basic grammar

Java Collections Class Overview and Use