<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-3939502048416062406</atom:id><lastBuildDate>Fri, 06 Jun 2025 13:11:07 +0000</lastBuildDate><category>Build docker image</category><category>Container</category><category>Docker</category><category>Image</category><category>web based Docker Image.</category><title>Binod Java Solution</title><description>Maximum try to solve your issue and give some useful information on java technology.</description><link>http://binodsuman.blogspot.com/</link><managingEditor>noreply@blogger.com (Binod Suman)</managingEditor><generator>Blogger</generator><openSearch:totalResults>95</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-2464310475572076985</guid><pubDate>Fri, 12 Oct 2018 18:30:00 +0000</pubDate><atom:updated>2018-10-12T11:30:22.020-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Build docker image</category><category domain="http://www.blogger.com/atom/ns#">Container</category><category domain="http://www.blogger.com/atom/ns#">Docker</category><category domain="http://www.blogger.com/atom/ns#">Image</category><category domain="http://www.blogger.com/atom/ns#">web based Docker Image.</category><title>Steps To Build Web Server Docker Image - 2 min job</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
I assume you must be knowing what is Docker, Container and their concept.&lt;br /&gt;
Here I am giving only basic steps to develop Docker Image for web based application. This tutorial will give you very basic temple on how to develop web based Docker Image.&lt;br /&gt;
&lt;br /&gt;
Please use comment box if you have any question or suggestion.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 1&lt;/b&gt;: Create one HTML file, say index.html&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;-en-clipboard: true;&quot;&gt;
&lt;title&gt;Binod Suman &lt;/title&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h2&gt;
 This web page from Docker / Kubernetes &lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
Current time&lt;/div&gt;
&lt;div&gt;
&lt;div id=&quot;datetime&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;script&gt;&lt;/div&gt;
&lt;div&gt;
var dt = new Date();&lt;/div&gt;
&lt;div&gt;
document.getElementById(&quot;datetime&quot;).innerHTML = dt.toLocaleString();&lt;/div&gt;
&lt;div&gt;
&lt;/script&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 2&lt;/b&gt;: Create one Docker file&lt;br /&gt;
&lt;br /&gt;
&lt;span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;-en-clipboard: true;&quot;&gt;
FROM centos:latest&lt;/div&gt;
&lt;div&gt;
RUN yum -y install httpd&lt;/div&gt;
&lt;div&gt;
COPY index.html /var/www/html/&lt;/div&gt;
&lt;div&gt;
CMD [&quot;/usr/sbin/httpd&quot;,&quot;-D&quot;,&quot;FOREGROUND&quot;]&lt;/div&gt;
&lt;div&gt;
EXPOSE 80&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 3&lt;/b&gt;: Build Docker Image, use below command&lt;br /&gt;
docker build -t hello-web .&lt;br /&gt;
NOTE: one dot is there at last in above command. I assume index.html and Docker are in the folder that why I used dot else you can give path of Dockerfile as well.&lt;br /&gt;
&lt;br /&gt;
Now your Docker Image ready to use. How to use:&lt;br /&gt;
&lt;br /&gt;
docker run -p 3123:80 -it hello-web:latest&lt;br /&gt;
&lt;br /&gt;
Here 3123 is host machine port and 80 port where application is running in container.&lt;br /&gt;
&lt;br /&gt;
Go your web brower:&lt;br /&gt;
http://locahost:3123&lt;br /&gt;
&lt;br /&gt;
You will get output, like some thing:&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;-en-clipboard: true; -webkit-text-stroke-width: 0px; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-variant-caps: normal; font-variant-ligatures: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;This web page from Docker / Kubernetes&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;-webkit-text-stroke-width: 0px; color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: small; font-variant-caps: normal; font-variant-ligatures: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Current time&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;-en-paragraph: true; -webkit-text-stroke-width: 0px; color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: small; font-variant-caps: normal; font-variant-ligatures: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;10/12/2018, 11:58:36 PM&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;-en-paragraph: true; -webkit-text-stroke-width: 0px; color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: small; font-variant-caps: normal; font-variant-ligatures: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;-en-paragraph: true; -webkit-text-stroke-width: 0px; color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: small; font-variant-caps: normal; font-variant-ligatures: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;I have already push this image to docker hub, you can directly pull from there:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
docker pull binodsuman/hello-web&lt;/div&gt;
&lt;div&gt;
docker run -p 3123:80 -it binodsuman/hello-web:latest&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;-en-paragraph: true; -webkit-text-stroke-width: 0px; color: black; font-family: &amp;quot;Times New Roman&amp;quot;; font-size: small; font-variant-caps: normal; font-variant-ligatures: normal; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2018/10/steps-to-build-web-server-docker-image.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-2390976401956544945</guid><pubDate>Fri, 23 Feb 2018 15:16:00 +0000</pubDate><atom:updated>2018-02-23T07:16:30.786-08:00</atom:updated><title>Connect Amazon S3 from Java code. Amazon S3 with Java. Amazon S3 Java code example using the AWS SDK. Upload single or  multiple object using AWS Java SDK</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Login to aws.amazon.com&lt;br /&gt;
Create one user from IAM and give access these things:&lt;br /&gt;
AWSConnector&lt;br /&gt;
AmazonS3FullAccess&lt;br /&gt;
&lt;br /&gt;
And copy &quot;Access Key&quot; and &quot;Secret Access Key&quot; and it will using in your java code to establish connection.&lt;br /&gt;
&lt;br /&gt;
Create one Maven Project in any Eclipse and add this below one dependency:&lt;br /&gt;
&lt;br /&gt;
&lt;dependency&gt;&lt;/dependency&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;groupid&gt;com.amazonaws&lt;/groupid&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;artifactid&gt;aws-java-sdk&lt;/artifactid&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;version&gt;1.9.2&lt;/version&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Then use below code to create bucket, create folder and upload some text file.&lt;br /&gt;
&lt;br /&gt;
package AmazonS3.amazondemo;&lt;br /&gt;
&lt;br /&gt;
import java.io.ByteArrayInputStream;&lt;br /&gt;
import java.io.File;&lt;br /&gt;
import java.io.InputStream;&lt;br /&gt;
&lt;br /&gt;
import com.amazonaws.auth.AWSCredentials;&lt;br /&gt;
import com.amazonaws.auth.BasicAWSCredentials;&lt;br /&gt;
import com.amazonaws.services.s3.AmazonS3;&lt;br /&gt;
import com.amazonaws.services.s3.AmazonS3Client;&lt;br /&gt;
import com.amazonaws.services.s3.model.Bucket;&lt;br /&gt;
import com.amazonaws.services.s3.model.ObjectMetadata;&lt;br /&gt;
import com.amazonaws.services.s3.model.PutObjectRequest;&lt;br /&gt;
&lt;br /&gt;
public class App&lt;br /&gt;
{&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;static String accessKey = &quot;**********************************&quot;;&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;static String secretAccessKey = &quot;********************************************&quot;;&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static void main( String[] args )&lt;br /&gt;
&amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println( &quot;Demo for Amazon S3 connectivity from Standalone Java code!&quot; );&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AWSCredentials awsCredentials = new BasicAWSCredentials(accessKey, secretAccessKey);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AmazonS3 amazonS3Client = new AmazonS3Client(awsCredentials);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Bucket is being created ..................&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String bucketName = &quot;bucktbyjavacode&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; amazonS3Client.createBucket(bucketName);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(Bucket bucket : amazonS3Client.listBuckets()){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;System.out.println(&quot;Bucket in Amazon S3 :&quot;+bucket.getName());&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;Folder is being created ................&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String newFolderName = &quot;Folder_by_Java_Code&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; App demo = new App();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //demo.createNewFolder(bucketName, newFolderName, amazonS3Client);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String fileName = &quot;demotextfile.txt&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; amazonS3Client.putObject(new PutObjectRequest(bucketName, fileName, new File(&quot;D:\\demotextfile.txt&quot;)));&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;All Done ............&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private void createNewFolder(String bucketName, String newFolderName, AmazonS3 amazonClient){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;ObjectMetadata metaData = new ObjectMetadata();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;metaData.setContentLength(0);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;InputStream emptyContent = new ByteArrayInputStream(new byte[0]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, newFolderName, emptyContent, metaData);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;amazonClient.putObject(putObjectRequest);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2018/02/connect-amazon-s3-from-java-code-amazon.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-4278140123095649611</guid><pubDate>Fri, 16 Feb 2018 04:14:00 +0000</pubDate><atom:updated>2018-02-15T20:38:05.644-08:00</atom:updated><title>How to Call R from Java using Rserve, R Programming through Java</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
We
will use Rserve software to connect our Java code to R environment. Rserve is a
TCP/IP server which allows other programs to use facilities of R&amp;nbsp; from various languages without the need to
initialize R or link against R library. Every connection has a separate
workspace and working directory. For more details please refer this page &lt;a href=&quot;https://www.rforge.net/Rserve/&quot;&gt;https://www.rforge.net/Rserve/&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ol style=&quot;direction: ltr; margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; unicode-bidi: embed;&quot; type=&quot;1&quot;&gt;
&lt;li style=&quot;font-family: calibri; font-size: 11pt; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;&quot; value=&quot;1&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;Install R software in your
     computer somewhere. (My case it is D:\InstalledSoftware\R-3.4.3)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: calibri; font-size: 11pt; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;Start your R environment&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: calibri; font-size: 11pt; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;Install Rserve package (use
     command install.packages(&quot;Rserve&quot;))&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: calibri; font-size: 11pt; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;Start Rserve in your R
     environment (use command library(Rserve))&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: calibri; font-size: 11pt; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;That’s it from R side.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: calibri; font-size: 11pt; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;Now setup your Java project.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: calibri; font-size: 11pt; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;Open any Eclipse, create java
     project say &quot;RJavaConnect&quot;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: calibri; font-size: 11pt; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;Add two Rserve related jar
     file in your RJavaConnect project (REngine.jar and Rserve.jar)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;font-family: calibri; font-size: 11pt; margin-bottom: 0px; margin-top: 0px; vertical-align: middle;&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;You can get both jar from
     D:\InstalledSoftware\R-3.4.3\library\Rserve\java (In your case check your
     R installation path). Else you can add these two dependency in your pom.xml&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;font-family: calibri; font-size: 14.6667px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;dependency&gt;&lt;/dependency&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol style=&quot;margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; text-align: left; unicode-bidi: embed;&quot; type=&quot;1&quot;&gt;&lt;/ol&gt;
&lt;span style=&quot;font-family: calibri; font-size: 14.6667px; white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;font-family: calibri; font-size: 14.6667px;&quot;&gt;&lt;groupid&gt;org.nuiton.thirdparty&lt;/groupid&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol style=&quot;margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; text-align: left; unicode-bidi: embed;&quot; type=&quot;1&quot;&gt;&lt;/ol&gt;
&lt;span style=&quot;font-family: calibri; font-size: 14.6667px; white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;font-family: calibri; font-size: 14.6667px;&quot;&gt;&lt;artifactid&gt;REngine&lt;/artifactid&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol style=&quot;margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; text-align: left; unicode-bidi: embed;&quot; type=&quot;1&quot;&gt;&lt;/ol&gt;
&lt;span style=&quot;font-family: calibri; font-size: 14.6667px; white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;font-family: calibri; font-size: 14.6667px;&quot;&gt;&lt;version&gt;1.8-5&lt;/version&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol style=&quot;margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; text-align: left; unicode-bidi: embed;&quot; type=&quot;1&quot;&gt;&lt;/ol&gt;
&lt;span style=&quot;font-family: calibri; font-size: 14.6667px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;font-family: calibri; font-size: 14.6667px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;ol style=&quot;margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; text-align: left; unicode-bidi: embed;&quot; type=&quot;1&quot;&gt;&lt;/ol&gt;
&lt;span style=&quot;font-family: calibri;&quot;&gt;&lt;span style=&quot;font-size: 14.6667px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ol style=&quot;margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; text-align: left; unicode-bidi: embed;&quot; type=&quot;1&quot;&gt;&lt;/ol&gt;
&lt;span style=&quot;font-family: calibri; font-size: 14.6667px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;font-family: calibri; font-size: 14.6667px;&quot;&gt;&lt;dependency&gt;&lt;/dependency&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol style=&quot;margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; text-align: left; unicode-bidi: embed;&quot; type=&quot;1&quot;&gt;&lt;/ol&gt;
&lt;span style=&quot;font-family: calibri; font-size: 14.6667px; white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;font-family: calibri; font-size: 14.6667px;&quot;&gt;&lt;groupid&gt;org.nuiton.thirdparty&lt;/groupid&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol style=&quot;margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; text-align: left; unicode-bidi: embed;&quot; type=&quot;1&quot;&gt;&lt;/ol&gt;
&lt;span style=&quot;font-family: calibri; font-size: 14.6667px; white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;font-family: calibri; font-size: 14.6667px;&quot;&gt;&lt;artifactid&gt;Rserve&lt;/artifactid&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol style=&quot;margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; text-align: left; unicode-bidi: embed;&quot; type=&quot;1&quot;&gt;&lt;/ol&gt;
&lt;span style=&quot;font-family: calibri; font-size: 14.6667px; white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;font-family: calibri; font-size: 14.6667px;&quot;&gt;&lt;version&gt;1.8-5&lt;/version&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol style=&quot;margin-bottom: 0in; margin-left: 0.375in; margin-top: 0in; text-align: left; unicode-bidi: embed;&quot; type=&quot;1&quot;&gt;&lt;/ol&gt;
&lt;span style=&quot;font-family: calibri; font-size: 14.6667px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;font-family: calibri; font-size: 14.6667px;&quot;&gt;&lt;/span&gt;&lt;div&gt;
&lt;span style=&quot;font-family: calibri; font-size: 14.6667px;&quot;&gt;&amp;nbsp; &amp;nbsp;Finally, c&lt;/span&gt;&lt;span style=&quot;font-family: calibri; font-size: 11pt;&quot;&gt;reate one Java Class say
     Demo.java and execute below code. That’s it :)&lt;/span&gt;&lt;div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
package pkg;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
import
org.rosuda.REngine.REXP;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
import
org.rosuda.REngine.REXPMismatchException;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
import
org.rosuda.REngine.REngineException;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
import
org.rosuda.REngine.Rserve.RConnection;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
import
org.rosuda.REngine.Rserve.RserveException;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
public class Demo {&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
RConnection
connection = null;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
public
static void main(String[] args) {&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin-left: .75in; margin: 0in;&quot;&gt;
Demo
demo = new Demo();&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin-left: .75in; margin: 0in;&quot;&gt;
demo.connectToR();&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
public
void connectToR(){&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-size: 11pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-size: 11pt;&quot;&gt;try{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-size: 11pt;&quot;&gt;connection
= new RConnection();&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-size: 11pt;&quot;&gt;String
vector = &quot;c(1,2,3,4)&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
connection.eval(&quot;meanVal=mean(&quot; + vector + &quot;)&quot;);&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double mean =
connection.eval(&quot;meanVal&quot;).asDouble();&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&quot;The mean
of given vector is=&quot; + mean);&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String setwd =
&quot;setwd(\&quot;d:/InstalledSoftware/RStudio\&quot;)&quot;;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connection.eval(setwd);&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vector =
&quot;binod&lt;-c p=&quot;&quot;&gt;&lt;/-c&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connection.eval(vector);*/&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int[] input = {10,20,30,40,50};&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
connection.assign(&quot;input&quot;, input);&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REXP output =
connection.eval(&quot;mean(input)&quot;);&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&quot;Mean of
out input data :&quot;+output);&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&quot;Mean of
out input data :&quot;+output.asDouble());&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;font-size: 11pt;&quot;&gt;}catch
(RserveException e) {&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}catch (REXPMismatchException e) {&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.printStackTrace();&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (REngineException e) {&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.printStackTrace();&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}finally{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if(connection
!= null){&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connection.close();&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-size: 11pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11.0pt; margin: 0in;&quot;&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2018/02/how-to-call-r-from-java-using-rserve-r.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-1963038369020878717</guid><pubDate>Sat, 18 Jun 2016 14:53:00 +0000</pubDate><atom:updated>2016-06-18T07:53:24.138-07:00</atom:updated><title>java.util.Optional, Tired of Null Pointer Exceptions, get rid of Null Pointer Exceptions, Handle NullPointerException in Java</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
See this below java code to add two Integer:&lt;br /&gt;
&lt;br /&gt;
public Integer sumOfTwoInteger(Integer a, Integer b){&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; return a + b;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here, sumOfTwoInteger() method at all not taking care of any of the method arguments, this method will be executed either you pass any valid Integer value or any null value. Even, from where (caller method) you will call this sumOfTwoInteger() method, caller method will be also taking care for data is going to pass to sumOfTwoInteger() method. Finally ends up with this below error message:&lt;br /&gt;
&lt;br /&gt;
Integer a = null;&lt;br /&gt;
Integer b = 10;&lt;br /&gt;
&lt;br /&gt;
System.out.println(test.sumOfTwoInteger(a,b));&lt;br /&gt;
&lt;br /&gt;
Exception in thread &quot;main&quot; java.lang.NullPointerException&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;at Tester.sumOfTwoInteger(GuavaTester.java:19)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;at Tester.main(GuavaTester.java:14)&lt;br /&gt;
&lt;br /&gt;
Now, how to handle this kind of situation where null check is to be check always and each and every place, before calling method or during method is being executed.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;User&amp;nbsp;java.util.Optional package.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
import java.util.Optional;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
public class Tester {&lt;br /&gt;
&amp;nbsp; &amp;nbsp;public static void main(String args[]) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; Tester guavaTester = new Tester();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; Integer invalidInput = null;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; Optional&lt;integer&gt; a = &amp;nbsp;Optional.of(invalidInput);&lt;/integer&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; Optional&lt;integer&gt; b = &amp;nbsp;Optional.of(new Integer(10));&lt;/integer&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(guavaTester.sumOfTwoInteger(a,b));&lt;br /&gt;
&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;public Integer sumOfTwoInteger(Optional&lt;integer&gt; a, Optional&lt;integer&gt; b){&lt;/integer&gt;&lt;/integer&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;return a.get() + b.get();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Now, when you will run this code, it will give error at line, where you are trying to create Integer value a.&lt;br /&gt;
&lt;br /&gt;
Exception in thread &quot;main&quot; java.lang.NullPointerException&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;at java.util.Objects.requireNonNull(Unknown Source)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;at java.util.Optional.&lt;init&gt;(Unknown Source)&lt;/init&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;at java.util.Optional.of(Unknown Source)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;at Tester.main(Tester.java:11)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More details at&amp;nbsp;http://www.tutorialspoint.com/guava/index.htm&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2016/06/javautiloptional-tired-of-null-pointer.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-373606022538189788</guid><pubDate>Thu, 28 Apr 2016 09:36:00 +0000</pubDate><atom:updated>2016-04-28T02:36:34.416-07:00</atom:updated><title>Create index in kibana using curl command, Index creation in Kibana by code, Kibana index by command, create index in Kibana in background</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Your ElasticSearch Servar and Kibana server should be running during this poc.&lt;br /&gt;
&lt;br /&gt;
Just assume,&lt;br /&gt;
&lt;br /&gt;
Kibana is running at 10.20.30.40:5601&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First requirement, you should have same index in your Elasticsearch for which you wanted to create index in Kibana.&lt;br /&gt;
If you do not have any index in Elasticsearch then first create it.&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&quot;_index&quot;: &quot;twiteer_one&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_type&quot;: &quot;tweet&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_id&quot;: &quot;2&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_score&quot;: 1,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_source&quot;: {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;nick&quot;: &quot;Ishan@gmail.com&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;date&quot;: &quot;2015-02-10&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;post&quot;: &quot;NCFE&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;other_name&quot;: &quot;Ishan Suman&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_index&quot;: &quot;twiteer_one&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_type&quot;: &quot;tweet&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_id&quot;: &quot;17&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_score&quot;: 1,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_source&quot;: {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;nick&quot;: &quot;@binodsuman&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;date&quot;: &quot;2014-08-15&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;post&quot;: &quot;BigData, Kibana, ES, ML&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;other_name&quot;: &quot;Binod Suman&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
I hope your Elasticsearch must be running while using below command.&lt;br /&gt;
&lt;br /&gt;
Now suppose you want to create index with name twiteer_one in your kibana, then use this below command in lunux flavor machine. (This command gives some error while executing in Windows Machine).&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;curl&lt;/span&gt;&lt;/b&gt; -H &amp;nbsp;&quot;Content-Type: application/json&quot; -XPOST -i -H &quot;kbn-version:4.4.2&quot; http://10.20.30.40:5601/elasticsearch/.kibana/index-pattern/twiteer_one?op_type=create -d &#39;{&quot;title&quot;: &quot;twiteer_two&quot;, &quot;timeFieldName&quot;: &quot;date&quot;}&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
After successfully execute this command, come in Kibana and check.&lt;br /&gt;
&lt;br /&gt;
Kibana -&amp;gt; Settings -&amp;gt; Indices, your&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;twiteer_two &lt;/span&gt;index should be here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2016/04/create-index-in-kibana-using-curl.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-5374107178355487674</guid><pubDate>Wed, 27 Apr 2016 18:08:00 +0000</pubDate><atom:updated>2016-04-27T11:08:25.397-07:00</atom:updated><title>Export and import via curl kibana’s dashboards and visualizations, Kibana Dashboard export into another Elasticsearch, command line load dashboard, How to save dashboard as json file, Location of custom Kibana dashboards in ElasticSearch</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
First in create some index and data in first ElasticSearch. As per my example:&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&quot;_index&quot;: &quot;twiteer_one&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_type&quot;: &quot;tweet&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_id&quot;: &quot;2&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_score&quot;: 1,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_source&quot;: {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;nick&quot;: &quot;Ishan@gmail.com&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;date&quot;: &quot;2015-02-10&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;post&quot;: &quot;NCFE&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;other_name&quot;: &quot;Ishan Suman&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_index&quot;: &quot;twiteer_one&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_type&quot;: &quot;tweet&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_id&quot;: &quot;17&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_score&quot;: 1,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;_source&quot;: {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;nick&quot;: &quot;@binodsuman&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;date&quot;: &quot;2014-08-15&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;post&quot;: &quot;BigData, Kibana, ES, ML&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&quot;other_name&quot;: &quot;Binod Suman&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;- Connect this first ElasticSearch into your kibana dashboard.&lt;br /&gt;
&amp;nbsp;- Create two visualization using above index &quot;twiteer_one&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;In my case, First-Visualization and Second-Visualization&lt;br /&gt;
&amp;nbsp;- Create one Dashboard in kibana using these two visualization.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;In my case my Dashboard name is &quot;My-Dashboard&quot;.&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
- Export all three item (two visualization and one dashboard) individually from Kibana.&lt;br /&gt;
&amp;nbsp; HOW: In Kibana -&amp;gt; go to Settings -&amp;gt; Objects -&amp;gt; Visualization and&lt;br /&gt;
&amp;nbsp; &amp;nbsp;* tick on First Visualization and export and save in one folder with name v1.json&lt;br /&gt;
&amp;nbsp; &amp;nbsp;* tick on Second &amp;nbsp;Visualization and export and save in one folder with name v2.json&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp;- In Kibana -&amp;gt; go to Settings -&amp;gt; Objects -&amp;gt; Dashboard and&lt;br /&gt;
&amp;nbsp; &amp;nbsp;* tick on My Dashboard and export and save in one folder with name dashboard.json&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; - Stop this first ElasticSearch&lt;br /&gt;
&amp;nbsp; - Start your second ElasticSearch, make sure you should have same index &quot;twiteer_one&quot; with same set of data.&lt;br /&gt;
&amp;nbsp; Edit v1.json and remove first four line and your file should like this:&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;title&quot;: &quot;First Visualization&quot;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;visState&quot;: &quot;{\&quot;title\&quot;:\&quot;New&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;----&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;-----&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &quot;searchSourceJSON&quot;: &quot;{\&quot;index\&quot;:\&quot;twiteer_one\&quot;,\&quot;query\&quot;:{\&quot;query_string\&quot;:{\&quot;query\&quot;:\&quot;*\&quot;,\&quot;analyze_wildcard\&quot;:true}},\&quot;filter\&quot;:[]}&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; Edit v2.json and dashboard.json also and remove first four lines.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp; Execute these three curl command:&lt;br /&gt;
&amp;nbsp; D:\Kibana_Json&amp;gt;curl localhost:9200/.kibana/visualization/First-Visualization -d @v1.json&lt;br /&gt;
&amp;nbsp; D:\Kibana_Json&amp;gt;curl localhost:9200/.kibana/visualization/Second-Visualization -d @v2.json&lt;br /&gt;
&amp;nbsp; D:\Kibana_Json&amp;gt;curl localhost:9200/.kibana/dashboard/My-Dashboard -d @dashboard.json&lt;br /&gt;
&amp;nbsp; Make sure after executing each command you must get &quot;created&quot;:true message.&lt;br /&gt;
&amp;nbsp; {&quot;_index&quot;:&quot;.kibana&quot;,&quot;_type&quot;:&quot;dashboard&quot;,&quot;_id&quot;:&quot;My-Dashboard&quot;,&quot;_version&quot;:1,&quot;_shards&quot;:{&quot;total&quot;:2,&quot;successful&quot;:1,&quot;failed&quot;:0},&quot;created&quot;:true}&lt;br /&gt;
D:\Kibana_Json&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; Now you connect second ElasticSearch with Kibana and you will be getting all your visualization and Dashboard.&lt;br /&gt;
&amp;nbsp; Please write if any problem or feedback.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2016/04/export-and-import-via-curl-kibanas.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-912649237691612444</guid><pubDate>Thu, 24 Mar 2016 11:40:00 +0000</pubDate><atom:updated>2016-03-24T04:40:01.500-07:00</atom:updated><title>SSL enable Server and Client side code, KeyStore, KeyManagerFactory, SSLContext, SSLServerSocketFactory, easy example of Java SSL code, getting start with SSL, What is SSL, Wha  is the use of SSL, keytool command, SSL Client java code, How to write SSL enable client side code</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;SSL (Secure Sockets Layer) provides a secure connection between internet browsers and websites, allowing you to transmit private data online.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Server used to have private and public key (key OR certificate). Server creator either can take certificate from some well known Certificate Authority (CA) or&amp;nbsp;generate their own certificate using java keytool command. When client wants to connect server, server send public key to client and handshake happens between both.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Using server&#39;s public key, all data which go from client to server are encrypted by server&#39;s public key and at server side using private key, server can&amp;nbsp;decrypted those client data. But instead always using public and private key, after handshake both client and server use one symmetric key for their encryption and&amp;nbsp;decryption.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;How to generate your own key using JDK keytool command.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Courier New, Courier, monospace;&quot;&gt;keytool -genkey -keystore demokeystore -keyalg RSA&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;I use &quot;password&quot; as password while generating this keystore.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;SSLServerDemo.java&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import javax.net.ssl.KeyManagerFactory;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import javax.net.ssl.SSLContext;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import javax.net.ssl.SSLServerSocket;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import javax.net.ssl.SSLServerSocketFactory;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import javax.net.ssl.SSLSocket;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import javax.net.ssl.TrustManagerFactory;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import java.io.BufferedReader;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import java.io.FileInputStream;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import java.io.InputStream;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import java.io.InputStreamReader;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import java.security.KeyStore;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;public class SSLServerDemo {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; public static void main(String[] arstring) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;SSLContext sslContext;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;System.out.println(&quot;** Servlet start with inbuild SSL **&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;InputStream kis = new FileInputStream(&quot;demokeystore&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;KeyStore keyStore = KeyStore.getInstance(&quot;jks&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;keyStore.load(kis, &quot;password&quot;.toCharArray());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;keyManagerFactory.init(keyStore, &quot;password&quot;.toCharArray());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sslContext = SSLContext.getInstance(&quot;TLS&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sslContext.init(keyManagerFactory.getKeyManagers(), null, null);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SSLServerSocketFactory sslserversocketfactory = sslContext.getServerSocketFactory();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SSLServerSocket sslserversocket = (SSLServerSocket) sslserversocketfactory.createServerSocket(9000);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SSLSocket sslsocket = (SSLSocket) sslserversocket.accept();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;InputStream inputstream = sslsocket.getInputStream();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;InputStreamReader inputstreamreader = new InputStreamReader(inputstream);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BufferedReader bufferedreader = new BufferedReader(inputstreamreader);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String string = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;while ((string = bufferedreader.readLine()) != null) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;From SSL Server :&quot;+string);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (Exception e) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;SSLClientDemo.java&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import javax.net.ssl.KeyManagerFactory;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import javax.net.ssl.SSLContext;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import javax.net.ssl.SSLServerSocketFactory;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import javax.net.ssl.SSLSocket;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import javax.net.ssl.SSLSocketFactory;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import javax.net.ssl.TrustManagerFactory;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import java.io.*;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;import java.security.KeyStore;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;public class SSLClientDemo {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; public static void main(String[] arstring) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;SSLContext sslContext;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;InputStream kis = new FileInputStream(&quot;demokeystore&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; KeyStore trustStore = KeyStore.getInstance(&quot;jks&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; trustStore.load(kis, &quot;password&quot;.toCharArray());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; trustManagerFactory.init(trustStore);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sslContext = SSLContext.getInstance(&quot;TLS&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sslContext.init(null, trustManagerFactory.getTrustManagers(), null);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SSLSocketFactory sslsocketfactory = sslContext.getSocketFactory();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SSLSocket sslsocket = (SSLSocket) sslsocketfactory.createSocket(&quot;localhost&quot;, 9000);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InputStream inputstream = System.in;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InputStreamReader inputstreamreader = new InputStreamReader(inputstream);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BufferedReader bufferedreader = new BufferedReader(inputstreamreader);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OutputStream outputstream = sslsocket.getOutputStream();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OutputStreamWriter outputstreamwriter = new OutputStreamWriter(outputstream);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BufferedWriter bufferedwriter = new BufferedWriter(outputstreamwriter);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String string = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while ((string = bufferedreader.readLine()) != null) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bufferedwriter.write(string + &#39;\n&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bufferedwriter.flush();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (Exception e) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Compile both java file and run both. Now if you type any message in client side, it will send to server side code.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2016/03/ssl-enable-server-and-client-side-code.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-4390266596120680991</guid><pubDate>Tue, 22 Mar 2016 18:16:00 +0000</pubDate><atom:updated>2016-03-22T11:16:41.107-07:00</atom:updated><title>How to write ElasticSearch 2.2 plugin, Getting start Elasticsearch Plugin, Develop ElasticSearch Plugin, How to debug elasticsearch plugin using eclipse, Remote debuging in Elasticsearch plugin, first plugin in Elasticsearch, </title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;How to develop custom plugin for ElasticSearch 2.2&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;What is Plugin:&lt;/b&gt;&lt;br /&gt;
Plugins are a way to enhance the basic elasticsearch functionality in a custom manner. They range from adding custom mapping types, custom analyzers, native scripts, custom discovery and more.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;There are three types of plugins:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;- Java plugins&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; These plugins contain only JAR files, and must be installed on every node in the cluster. After installation, each node must be restarted before the plugin becomes visible.&lt;br /&gt;
&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;- Site plugins&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; These plugins contain static web content like Javascript, HTML, and CSS files, that can be served directly from Elasticsearch.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; http://yournode:9200/_plugin/[plugin name]&lt;br /&gt;
&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;- Mixed plugins&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&amp;nbsp; Mixed plugins contain both JAR files and web content.&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Here, I am going to develop Java Plugins.&lt;br /&gt;
1. Create one simple Maven project from Eclipse.&lt;br /&gt;
2. Add below things to your pom.xml&lt;br /&gt;
&amp;nbsp;&lt;project p=&quot;&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot;&gt;&amp;nbsp;&lt;/project&gt;&lt;br /&gt;
&amp;lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;br /&gt;
&amp;nbsp; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;modelVersion&amp;gt;4.0.0&amp;lt;/modelVersion&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;groupId&amp;gt;org.elasticsearch&amp;lt;/groupId&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;artifactId&amp;gt;es_plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;version&amp;gt;1.1&amp;lt;/version&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;packaging&amp;gt;jar&amp;lt;/packaging&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;lt;name&amp;gt;es_plugin&amp;lt;/name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;lt;properties&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;project.build.sourceEncoding&amp;gt;UTF-8&amp;lt;/project.build.sourceEncoding&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;maven.compiler.source&amp;gt;1.8&amp;lt;/maven.compiler.source&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;maven.compiler.target&amp;gt;1.8&amp;lt;/maven.compiler.target&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/properties&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;lt;dependencies&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;dependency&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;groupId&amp;gt;org.elasticsearch&amp;lt;/groupId&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;artifactId&amp;gt;elasticsearch&amp;lt;/artifactId&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;version&amp;gt;2.2.1&amp;lt;/version&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/dependency&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/dependencies&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;build&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;finalName&amp;gt;${project.artifactId}&amp;lt;/finalName&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;plugins&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;plugin&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;artifactId&amp;gt;maven-assembly-plugin&amp;lt;/artifactId&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;version&amp;gt;2.5.5&amp;lt;/version&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;configuration&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;appendAssemblyId&amp;gt;false&amp;lt;/appendAssemblyId&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;outputDirectory&amp;gt;${project.build.directory}/releases/&amp;lt;/outputDirectory&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;descriptors&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;descriptor&amp;gt;${basedir}/src/main/assemblies/plugin.xml&amp;lt;/descriptor&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/descriptors&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/configuration&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/plugin&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/plugins&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/build&amp;gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;lt;/project&amp;gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
3. In side src folder, you should have these three folders.&lt;br /&gt;
&amp;nbsp; src -&amp;gt; assemblies, java and resources subfolder&lt;br /&gt;
4. Inside assemblies folder, plugin.xml&lt;br /&gt;
5. Inside resources, plugin-descriptor.properties file should be there.&lt;br /&gt;
6. Inside java folder, all java file under package, In my case&lt;br /&gt;
&amp;nbsp; &amp;nbsp;java\org\elasticsearch\es_plugin this folder has three java file.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;- App.java&lt;br /&gt;
&amp;nbsp; &amp;nbsp;- ExampleRestModule.java&lt;br /&gt;
&amp;nbsp; &amp;nbsp;- HelloRestHandler.java&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;** plugin.xml **&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;assembly p=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/assembly&gt;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;&lt;br /&gt;
&amp;lt;assembly&lt;br /&gt;
&amp;nbsp; &amp;nbsp; xmlns=&quot;http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; xsi:schemaLocation=&quot;http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;id&amp;gt;plugin&amp;lt;/id&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;formats&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;format&amp;gt;zip&amp;lt;/format&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/formats&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;includeBaseDirectory&amp;gt;false&amp;lt;/includeBaseDirectory&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;dependencySets&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;dependencySet&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;outputDirectory&amp;gt;/&amp;lt;/outputDirectory&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;useProjectArtifact&amp;gt;true&amp;lt;/useProjectArtifact&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;useTransitiveFiltering&amp;gt;true&amp;lt;/useTransitiveFiltering&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/dependencySet&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/dependencySets&amp;gt;&lt;br /&gt;
&amp;lt;/assembly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;** plugin-descriptor.properties **&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
# All plugins, be they site or Java plugins, must contain a file called plugin-descriptor.properties in the root directory.&lt;br /&gt;
# Elasticsearch plugin descriptor file&lt;br /&gt;
description=Binod Suman ES Demo Plugin&lt;br /&gt;
version=1.1&lt;br /&gt;
# &#39;name&#39;: the plugin name&lt;br /&gt;
name=Binod ES Plugin Demo&lt;br /&gt;
jvm=true&lt;br /&gt;
# &#39;classname&#39;: the name of the class to load, fully-qualified.&lt;br /&gt;
#classname=com.netiq.scm.SCMPlugin&lt;br /&gt;
classname=org.elasticsearch.es_plugin.App&lt;br /&gt;
java.version=1.8&lt;br /&gt;
elasticsearch.version=2.2.1&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;** App.java **&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
package org.elasticsearch.es_plugin;&lt;br /&gt;
&lt;br /&gt;
import java.util.Collection;&lt;br /&gt;
import java.util.Collections;&lt;br /&gt;
&lt;br /&gt;
import org.elasticsearch.common.inject.Module;&lt;br /&gt;
import org.elasticsearch.plugins.Plugin;&lt;br /&gt;
&lt;br /&gt;
@SuppressWarnings(&quot;static-method&quot;)&lt;br /&gt;
public class App extends Plugin {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public String name() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return &quot;Binod Suman ElasticSearch Demo Name&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public String description() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return &quot;** Purpose for this plugin to how to write first ElasticSearch Demo&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public Collection&lt;module&gt; nodeModules() {&lt;/module&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return Collections.&lt;module&gt;singletonList(new ExampleRestModule());&lt;/module&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;** ExampleRestModule.java **&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
package org.elasticsearch.es_plugin;&lt;br /&gt;
&lt;br /&gt;
import org.elasticsearch.common.inject.AbstractModule;&lt;br /&gt;
&lt;br /&gt;
public class ExampleRestModule extends AbstractModule {&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Override&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;protected void configure() {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;bind(HelloRestHandler.class).asEagerSingleton();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;** HelloRestHandler.java **&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
package org.elasticsearch.es_plugin;&lt;br /&gt;
&lt;br /&gt;
import org.elasticsearch.common.component.AbstractComponent;&lt;br /&gt;
import org.elasticsearch.common.inject.Inject;&lt;br /&gt;
import org.elasticsearch.common.settings.Settings;&lt;br /&gt;
&lt;br /&gt;
public class HelloRestHandler extends AbstractComponent &amp;nbsp;{&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;@Inject&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public HelloRestHandler(Settings settings) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;super(settings);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(&quot;**** Hello I am here in HelloResthandler Module of ES 2 **&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;** Now build your code by pom.xml **&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;u&gt;mvn clean install&lt;/u&gt;&lt;br /&gt;
It will create one jar file &quot;es_plugin.jar&quot; inside target folder.&lt;br /&gt;
&lt;br /&gt;
Create one folder in side your ElasticSearch installation Plugin folder. In my case, I created one folder&lt;br /&gt;
binod-demo-plugin inside E:\Software\elasticsearch-2.2.1\plugins folder.&lt;br /&gt;
Inside E:\Software\elasticsearch-2.2.1\plugins\binod-demo-plugin folder, I kept these two files:&lt;br /&gt;
&amp;nbsp;es_plugin.jar&lt;br /&gt;
&amp;nbsp;plugin-descriptor.properties&lt;br /&gt;
&lt;br /&gt;
Now try to restart ElasticSearch.&lt;br /&gt;
E:\Software\elasticsearch-2.2.1\bin&amp;gt;elasticsearch.bat&lt;br /&gt;
[2016-03-22 23:03:38,140][INFO ][node &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ] [Bison] version[2.2.1], pid[13000], build[d045fc2/2016-03-09T09:38:54Z]&lt;br /&gt;
[2016-03-22 23:03:38,141][INFO ][node &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ] [Bison] initializing ...&lt;br /&gt;
[2016-03-22 23:03:38,689][INFO ][plugins &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;] [Bison] modules [lang-expression, lang-groovy], plugins [&lt;b&gt;&lt;span style=&quot;color: purple;&quot;&gt;Binod ES Plugin Demo&lt;/span&gt;&lt;/b&gt;, scm], sites []&lt;br /&gt;
[2016-03-22 23:03:38,712][INFO ][env &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;] [Bison] using [1] data paths, mounts [[New Volume (E:)]], net usable_space [66.1gb], net total_space [157.8gb], spins? [unknown], types [NTFS]&lt;br /&gt;
[2016-03-22 23:03:38,712][INFO ][env &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;] [Bison] heap size [910.5mb], compressed ordinary object pointers [true]&lt;br /&gt;
[2016-03-22 23:03:38,931][INFO ][http &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ] [Bison] Using [org.elasticsearch.http.netty.NettyHttpServerTransport] as http transport, overridden by [SCM]&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: purple;&quot;&gt;**** Hello I am here in HelloResthandler Module of ES 2 **&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
[2016-03-22 23:03:39,779][INFO ][com.netiq.scm.Util &amp;nbsp; &amp;nbsp; &amp;nbsp; ] [Bison] java.home = D:\InstalledFolder\Java\jdk1.8.0_45\jre&lt;br /&gt;
[2016-03-22 23:03:39,780][ERROR][com.netiq.scm.Util &amp;nbsp; &amp;nbsp; &amp;nbsp; ] [Bison] E:\Software\elasticsearch-2.2.1\config\db.properties (The system cannot find the file specified)&lt;br /&gt;
[2016-03-22 23:03:40,878][ERROR][com.netiq.scm.Util &amp;nbsp; &amp;nbsp; &amp;nbsp; ] [Bison] Cannot sync configuration from SCM Core. java.net.MalformedURLException: no protocol: nullconfig/[get]&lt;br /&gt;
[2016-03-22 23:03:40,997][INFO ][node &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ] [Bison] initialized&lt;br /&gt;
[2016-03-22 23:03:40,997][INFO ][node &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ] [Bison] starting ...&lt;br /&gt;
-03-22 23:03:47,695][INFO ][node &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ] [Bison] started&lt;br /&gt;
&lt;br /&gt;
Here you can see the output carefully, some message comes from your own plugin.&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;**** How to set Debug breakpoint &amp;nbsp;*****&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
1. put break point of HelloRestHandler constructor&lt;br /&gt;
2. Add some extra parameter in elasticsearch.bat file.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;For More details: &lt;a href=&quot;http://binodsuman.blogspot.in/2016/03/how-to-call-elasticsearch-in-debug-mode.html&quot;&gt;http://binodsuman.blogspot.in/2016/03/how-to-call-elasticsearch-in-debug-mode.html&lt;/a&gt;&lt;br /&gt;
3. Set one remote debug for this project in Eclipse.&lt;br /&gt;
4. Now start ElasticSearch.bat with extra debug parameter and start project in Eclipse.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2016/03/how-to-write-elasticsearch-22-plugin.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-2983075377391767104</guid><pubDate>Tue, 22 Mar 2016 12:52:00 +0000</pubDate><atom:updated>2016-03-22T10:59:50.625-07:00</atom:updated><title>How to call ElasticSearch in debug mode, ElasticSearch 2.2 starts in debug mode, active debug mode in ElasticSearch, bat file add debug mode parameter, How add debug in batch file, How to debug elasticsearch plugin using eclipse</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
Inside bat file, from where you are calling ElasticSearch (In my case E:\Software\elasticsearch-2.2.1\bin\elasticsearch.bat) add these parameter&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8010&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Then go to Eclipse and in Remote Debug put port 8010 for your ElasticSearch Plugin Code.&lt;br /&gt;
&lt;br /&gt;
Here is full bat file to call ElasticSearch:&lt;br /&gt;
&lt;br /&gt;
@echo off&lt;br /&gt;
&lt;br /&gt;
SETLOCAL enabledelayedexpansion&lt;br /&gt;
TITLE Elasticsearch 2.2.1&lt;br /&gt;
&lt;br /&gt;
SET params=&#39;%*&#39;&lt;br /&gt;
&lt;br /&gt;
:loop&lt;br /&gt;
FOR /F &quot;usebackq tokens=1* delims= &quot; %%A IN (!params!) DO (&lt;br /&gt;
&amp;nbsp; &amp;nbsp; SET current=%%A&lt;br /&gt;
&amp;nbsp; &amp;nbsp; SET params=&#39;%%B&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;SET silent=N&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;IF &quot;!current!&quot; == &quot;-s&quot; (&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SET silent=Y&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;IF &quot;!current!&quot; == &quot;--silent&quot; (&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SET silent=Y&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;IF &quot;!silent!&quot; == &quot;Y&quot; (&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SET nopauseonerror=Y&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;) ELSE (&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;IF &quot;x!newparams!&quot; NEQ &quot;x&quot; (&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SET newparams=!newparams! !current!&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ) ELSE (&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SET newparams=!current!&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; IF &quot;x!params!&quot; NEQ &quot;x&quot; (&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;GOTO loop&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;)&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
SET HOSTNAME=%COMPUTERNAME%&lt;br /&gt;
&lt;br /&gt;
CALL &quot;%~dp0elasticsearch.in.bat&quot;&lt;br /&gt;
IF ERRORLEVEL 1 (&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;IF NOT DEFINED nopauseonerror (&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;PAUSE&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;EXIT /B %ERRORLEVEL%&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&quot;%JAVA_HOME%\bin\java&quot; &amp;nbsp;&lt;b&gt;-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8010 &lt;/b&gt;%JAVA_OPTS% %ES_JAVA_OPTS% %ES_PARAMS% -cp &quot;%ES_CLASSPATH%&quot; &quot;org.elasticsearch.bootstrap.Elasticsearch&quot; start !newparams!&lt;br /&gt;
&lt;br /&gt;
ENDLOCAL&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2016/03/how-to-call-elasticsearch-in-debug-mode.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-5698624277959007263</guid><pubDate>Thu, 03 Mar 2016 06:10:00 +0000</pubDate><atom:updated>2016-03-02T22:19:19.062-08:00</atom:updated><title>Java Regex to Validate IPV4, IPV6 IP address and Port range, Java IP address validation, Regex expression for IP address</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
private static final String ipv4Pattern = &quot;(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static final String ipv6Patten = &quot;^(((?=(?&amp;gt;.*?::)(?!.*::)))(::)?([0-9A-F]{1,4}::?){0,5}&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + &quot;|([0-9A-F]{1,4}:){6})(\\2([0-9A-F]{1,4}(::?|$)){0,2}|((25[0-5]&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + &quot;|(2[0-4]|1\\d|[1-9])?\\d)(\\.|$)){4}|[0-9A-F]{1,4}:[0-9A-F]{1,&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + &quot;4})(?&amp;lt;![^:]:|\\.)\\z&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private static final String portRegex = &quot;^(6553[0-5]|655[0-2]\\d|65[0-4]\\d\\d|6[0-4]\\d{3}|[1-5]\\d{4}|[2-9]\\d{3}|1[1-9]\\d{2}|10[3-9]\\d|102[4-9])$&quot;;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Complete Code:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
import java.util.ArrayList;&lt;/div&gt;
&lt;div&gt;
import java.util.Arrays;&lt;/div&gt;
&lt;div&gt;
import java.util.List;&lt;/div&gt;
&lt;div&gt;
import java.util.regex.Pattern;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
public class IPValidate {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static Pattern VALID_IPV4_PATTERN = null;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static Pattern VALID_IPV6_PATTERN = null;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static Pattern VALID_PORT_PATTERN = null;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static Pattern CHECK_IPV6_ADDRESS = null;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static String COMMA = &quot;,&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static String COLON = &quot;:&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static String CLOSE_BRACKET = &quot;]&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static String CLOSE_BRACKET_AND_COLON = &quot;]:&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static final String ipv4Pattern = &quot;(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static final String ipv6Patten = &quot;^(((?=(?&amp;gt;.*?::)(?!.*::)))(::)?([0-9A-F]{1,4}::?){0,5}&quot;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + &quot;|([0-9A-F]{1,4}:){6})(\\2([0-9A-F]{1,4}(::?|$)){0,2}|((25[0-5]&quot;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + &quot;|(2[0-4]|1\\d|[1-9])?\\d)(\\.|$)){4}|[0-9A-F]{1,4}:[0-9A-F]{1,&quot;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; + &quot;4})(?&amp;lt;![^:]:|\\.)\\z&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; private static final String portRegex = &quot;^(6553[0-5]|655[0-2]\\d|65[0-4]\\d\\d|6[0-4]\\d{3}|[1-5]\\d{4}|[2-9]\\d{3}|1[1-9]\\d{2}|10[3-9]\\d|102[4-9])$&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static final String ip6address = &quot;^\\[([0-9a-fA-F:]*)\\]:(.*)&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public IPValidate(){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;VALID_IPV4_PATTERN = Pattern.compile(ipv4Pattern, Pattern.CASE_INSENSITIVE);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;VALID_IPV6_PATTERN = Pattern.compile(ipv6Patten, Pattern.CASE_INSENSITIVE);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;VALID_PORT_PATTERN = Pattern.compile(portRegex, Pattern.CASE_INSENSITIVE);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;CHECK_IPV6_ADDRESS = Pattern.compile(ip6address, Pattern.CASE_INSENSITIVE);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private boolean validateIP4Address(String ip){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return VALID_IPV4_PATTERN.matcher(ip).matches();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private boolean validateIP6Address(String ip){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return VALID_IPV6_PATTERN.matcher(ip).matches();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private boolean validatePortNumber(String port){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return VALID_PORT_PATTERN.matcher(port).matches();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private boolean isIPV6Address(String ip){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return ip.contains(&quot;[&quot;)&amp;amp;&amp;amp;ip.contains(&quot;]&quot;);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private List&lt;string&gt; getSeperatedList(String data, String delimeter){&lt;/string&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;//return Pattern.compile(delimeter).splitAsStream(data).collect(Collectors.toList());&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return new ArrayList&lt;string&gt;(Arrays.asList(data.split(delimeter)));&lt;/string&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public boolean validateIPAddress(String ips){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;List&lt;string&gt; ipsList = getSeperatedList(ips,COMMA);&lt;/string&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;List&lt;string&gt; ipAndPort = null;&lt;/string&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String ipAddress = null;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String port = null;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;for(String ip : ipsList){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;ip=ip.trim();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if(isIPV6Address(ip)){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;ipAndPort = getSeperatedList(ip,CLOSE_BRACKET_AND_COLON);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if(ipAndPort.size()!=2){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;System.out.println(&quot;Invalid format. Please specify the IP addresses and port numbers again.&quot;);&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;return false;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;ipAddress = ipAndPort.get(0).trim().substring(1); // to remove [&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;port = ipAndPort.get(1).trim(); // to remove :&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if(!(validateIP6Address(ipAddress))){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;System.out.println(&quot;The specified IVP6 address is invalid. Please specify the IP addresses again.&quot;);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;return false;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}else{&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;ipAndPort = getSeperatedList(ip,COLON);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if(ipAndPort.size()!=2){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;System.out.println(&quot;Invalid format. Please specify the IP addresses and port numbers again.&quot;);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;return false;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;ipAddress = ipAndPort.get(0).trim();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;port = ipAndPort.get(1).trim();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if(!(validateIP4Address(ipAddress))){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;System.out.println(&quot;The specified IPV4 address is invalid. Please specify the IP addresses again.&quot;);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;return false;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if(!(validatePortNumber(port))){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;System.out.println(&quot;The specified port is invalid. Please specify port numbers again.&quot;);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;return false;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;return true;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static void main(String[] args) {&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;IPValidate demo = new IPValidate();&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String ips = &quot;[2001:0:1234::c1c0:abcd:876d]:9090,10.90.200.252:6500,29.90.39.89:2918,[2001:0:1234::c1c0:abcd:876]:9090&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;//String ips = &quot;[::1]:9090,10.90.20.98:8009&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;//String ips = &quot;[::1]:9099&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;//String ips = &quot;2.3.4.5:3757&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;//String ips=&quot;&quot;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;boolean isIPAddressValidate = demo.validateIPAddress(ips);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(&quot;isIPAddressValidate :&quot;+isIPAddressValidate);&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2016/03/java-regex-to-validate-ipv4-ipv6-ip.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-7072819061245765091</guid><pubDate>Mon, 16 Mar 2015 05:42:00 +0000</pubDate><atom:updated>2015-03-15T22:42:15.962-07:00</atom:updated><title>Java Difference between NoClassDefFoundError VS ClassNotFoundException in Java</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
** Difference between NoClassDefFoundError VS ClassNotFoundException in Java **&lt;br /&gt;
&lt;br /&gt;
Both exception due to missing classes in classpath.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;First we will see : NoClassDefFoundError&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Class Car{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Class Demo&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; public static void main(String[] args){&lt;br /&gt;
&amp;nbsp; &amp;nbsp;Car car = new Car();&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
e:\Binod&amp;gt; javac Demo.java&lt;br /&gt;
It will create Demo.class and Car.class&lt;br /&gt;
Now you go and delete Car.class&lt;br /&gt;
Now&lt;br /&gt;
e:\Binod&amp;gt;java Demo&lt;br /&gt;
You will get below exception:&lt;br /&gt;
Exception in thread &quot;main&quot; &lt;b&gt;java.lang.NoClassDefFoundError&lt;/b&gt;: Car&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at Demo2.main(Demo.java:9)&lt;br /&gt;
Caused by: java.lang.ClassNotFoundException: Car&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at java.net.URLClassLoader$1.run(URLClassLoader.java:366)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at java.net.URLClassLoader$1.run(URLClassLoader.java:355)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;******* &amp;nbsp;Now we will see ClassNotFoundException ********&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
ClassNotFoundException is a checked Exception derived directly from java.lang.Exception class and you need to provide explicit&lt;br /&gt;
&lt;br /&gt;
handling for it while NoClassDefFoundError is an Error derived from LinkageError.&lt;br /&gt;
&lt;br /&gt;
public class Demo {&lt;br /&gt;
&amp;nbsp; public static void main(String[] args) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Class check = Class.forName(&quot;Car&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (ClassNotFoundException e) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;e.printStackTrace();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Make sure Car.class should not be there in classpath.&lt;br /&gt;
e:\Binod&amp;gt; javac Demo.java&lt;br /&gt;
It will create Demo.class only&lt;br /&gt;
e:\Binod&amp;gt;java Demo&lt;br /&gt;
This time, you will get below exception:&lt;br /&gt;
&lt;br /&gt;
java.lang.&lt;b&gt;ClassNotFoundException&lt;/b&gt;: Car&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at java.net.URLClassLoader$1.run(URLClassLoader.java:366)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at java.net.URLClassLoader$1.run(URLClassLoader.java:355)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at java.security.AccessController.doPrivileged(Native Method)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at java.net.URLClassLoader.findClass(URLClassLoader.java:354)&lt;br /&gt;
&lt;br /&gt;
NOTE:&lt;br /&gt;
ClassNotFoundException comes in java if we try to load a class at run-time using with&lt;br /&gt;
&lt;b&gt;Class.forName()&lt;/b&gt; or&lt;br /&gt;
&lt;b&gt;ClassLoader.loadClass()&lt;/b&gt; or&lt;br /&gt;
&lt;b&gt;ClassLoader.findSystemClass()&lt;/b&gt; method&lt;br /&gt;
and requested class is not available in Java.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2015/03/java-difference-between.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-2615367168401645441</guid><pubDate>Thu, 26 Feb 2015 06:19:00 +0000</pubDate><atom:updated>2015-02-25T22:19:43.473-08:00</atom:updated><title>ExtJS Editable grid panel, extjs - Altering data in Ext.data.Model, Ext JS simple grid example with editable column, ExtJS Grid Edit Tutorial: Edit Data with an Ext JS Grid, ExtJs Simple Grid - Edit Column</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Very basic example of ExtJS 5.1 Grid Panel with editable column functionality.&lt;br /&gt;
For making column as editable, add two things:&lt;br /&gt;
&lt;br /&gt;
1. Add below plugin to your grid panel&lt;br /&gt;
plugins: [&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Ext.create(&#39;Ext.grid.plugin.CellEditing&#39;, {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clicksToEdit : 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; })&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ],&lt;br /&gt;
&lt;br /&gt;
2. In column definition add below configuration:&lt;br /&gt;
&lt;br /&gt;
editor: &#39;textfield&#39;&lt;br /&gt;
&lt;br /&gt;
Here is full running example:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&quot;en&quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;meta charset=&quot;UTF-8&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;ExtJS 5 Grid Example&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;extjs-5.1.0/packages/ext-theme-gray/build/resources/ext-theme-gray-all.css&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;extjs-5.1.0/extjs5.1.0-all-dashboard.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;style&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;.x-grid-item-selected .x-grid-cell {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;background-color: #B3D4FF !important;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;color :#000000 !important;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.onReady(function(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;Ext.define(&#39;Student&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;extend: &#39;Ext.data.Model&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;fields:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; {name: &#39;id&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; {name: &#39;name&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; {name: &#39;mobile&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; {name: &#39;TestColumn&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; convert : function(value, record){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; return record.get(&#39;name&#39;)+&quot; CHECK&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; }&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var studentStore = Ext.create(&#39;Ext.data.Store&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; model: &#39;Student&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;pageSize: 7,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; data:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;1&#39;, name:&#39;Binod&#39;, mobile:&#39;999999999&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;5&#39;, name:&#39;Ishan&#39;, mobile:&#39;898989898998&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;3&#39;, name:&#39;Akshu&#39;, mobile:&#39;1234123499&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;4&#39;, name:&#39;Sanjay 4&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;5&#39;, name:&#39;Sanjay 5&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;6&#39;, name:&#39;Sanjay 6&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;7&#39;, name:&#39;Sanjay 7&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;8&#39;, name:&#39;Sanjay 8&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;9&#39;, name:&#39;Sanjay 9&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;20&#39;, name:&#39;Sanjay 20&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;21&#39;, name:&#39;Sanjay 21&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;22&#39;, name:&#39;Sanjay 22&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;23&#39;, name:&#39;Sanjay 23&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;24&#39;, name:&#39;Zambia 24&#39;, mobile:&#39;8888999997&#39;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.create(&#39;bin.com.ResultGrid&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; renderTo: Ext.getBody(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; store: studentStore&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.define(&#39;bin.com.ResultGrid&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;extend: &#39;Ext.grid.Panel&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;width: 600,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 200,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;title: &#39;Student Records&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;b&gt;plugins: [&#39;gridfilters&#39;,&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Ext.create(&#39;Ext.grid.plugin.CellEditing&#39;, {&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clicksToEdit : 1&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; })&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ],&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;columns:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Roll Number&#39;, filter: &#39;string&#39;, dataIndex:&#39;id&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Name&#39; , filter: &#39;string&#39;,dataIndex:&#39;name&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Mobile&#39; , filter: &#39;string&#39;,dataIndex:&#39;mobile&#39;,&lt;b&gt; editor: &#39;textfield&#39;&lt;/b&gt;, flex: 1},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Test Column&#39; , filter: &#39;string&#39;,dataIndex:&#39;TestColumn&#39;, flex: 1},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;],&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;initComponent: function () {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;this.selModel = new Ext.selection.CheckboxModel( {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;this.callParent(arguments);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}); &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2015/02/extjs-editable-grid-panel-extjs.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-8797806928834344523</guid><pubDate>Fri, 13 Feb 2015 11:31:00 +0000</pubDate><atom:updated>2015-02-13T03:31:57.833-08:00</atom:updated><title>ExtJs 5.1 Paging tool not showing correct data when its load, Ext js Pagination issue in 5.1, ExtJs 5.1 Pagination tutorial, Ext JS pagingtoolbar not working during loading time</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
ExtJS 5.1 has one bug that when you load grid panel then first time it will not show correct paging number in paging tool. Once you do page next then it starts working.&lt;br /&gt;
During page load time it always show Page 1 of 1.&lt;br /&gt;
&lt;br /&gt;
First Pagination code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&quot;en&quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;meta charset=&quot;UTF-8&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;ExtJS 5.1.0 Grid Pagination Example&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;link rel=&quot;stylesheet&quot; href=&quot;extjs-5.1.0/packages/ext-theme-gray/build/resources/ext-theme-gray-all.css&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;extjs-5.1.0/extjs5.1.0-all-dashboard.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.onReady(function(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; Ext.define(&#39;Student&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;extend: &#39;Ext.data.Model&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;fields:[{name: &#39;id&#39;},{name: &#39;name&#39;},{name: &#39;mobile&#39;} ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var mydata = {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &quot;success&quot;:true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &quot;totalCount&quot;: 24,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &quot;rows&quot;:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:1, name:&#39;Binod&#39;, mobile:&#39;0000099257&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:2, name:&#39;Binod 2&#39;, mobile:&#39;0000099257&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:3, name:&#39;Akshu&#39;, mobile:&#39;12345070277&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:4, name:&#39;Sanjay 4&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:5, name:&#39;Sanjay 5&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:6, name:&#39;Sanjay 6&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:7, name:&#39;Sanjay 7&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:8, name:&#39;Sanjay 8&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:9, name:&#39;Sanjay 9&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:10, name:&#39;Sanjay 10&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:11, name:&#39;Sanjay 11&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:12, name:&#39;Sanjay 12&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:13, name:&#39;Sanjay 13 &#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:14, name:&#39;Sanjay 14&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:15, name:&#39;Sanjay 15&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:16, name:&#39;Sanjay 16&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:17, name:&#39;Sanjay 17&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:18, name:&#39;Sanjay 18&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:19, name:&#39;Sanjay 19&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:20, name:&#39;Sanjay 20&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:21, name:&#39;Sanjay 21&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:22, name:&#39;Sanjay 22&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:23, name:&#39;Sanjay 23&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:24, name:&#39;Zambia 24&#39;, mobile:&#39;8888999997&#39;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var storeProxy = {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type: &#39;memory&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; &amp;nbsp;enablePaging : true,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data: mydata&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;storeProxy.reader = {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type: &#39;json&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;totalProperty: &#39;totalCount&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;rootProperty: &#39;rows&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;successProperty: &#39;success&#39;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp;var studentStore = Ext.create(&#39;Ext.data.Store&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;model: &#39;Student&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;autoLoad: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;remoteSort: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;remoteFilter : true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;pageSize: 10,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;proxy: storeProxy&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var dockedPagingToolbar = [];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dockedPagingToolbar = [{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xtype: &#39;pagingtoolbar&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; store: studentStore, &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; afterPageText:&#39;of &#39;+Math.ceil( studentStore.proxy.data.rows.length / &amp;nbsp;studentStore.pageSize) ,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dock: &#39;bottom&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; displayInfo: true&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.create(&#39;Ext.grid.Panel&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;renderTo: Ext.getBody(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;store: studentStore,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;width: 450,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 250,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 290,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;multiSelect: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;title: &#39;Student Records&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;plugins: &#39;gridfilters&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; dockedItems : dockedPagingToolbar,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;columns:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {xtype: &#39;checkcolumn&#39;, text: &#39;Status&#39;, filter: &#39;string&#39;, dataIndex:&#39;status&#39;, width: 50},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Roll Number&#39;, filter: &#39;numeric&#39;, dataIndex:&#39;id&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Name&#39; , filter: &#39;string&#39;,dataIndex:&#39;name&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Mobile&#39; , filter: &#39;string&#39;,dataIndex:&#39;mobile&#39;, flex: 1}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}); &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Fix bug:&lt;br /&gt;
&lt;br /&gt;
var dockedPagingToolbar = [];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dockedPagingToolbar = [{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xtype: &#39;pagingtoolbar&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; store: studentStore, &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;b&gt;afterPageText:&#39;of &#39;+Math.ceil( studentStore.proxy.data.rows.length / &amp;nbsp;studentStore.pageSize) ,&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dock: &#39;bottom&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; displayInfo: true&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }];&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2015/02/extjs-51-paging-tool-not-showing.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-7185223188516253560</guid><pubDate>Thu, 12 Feb 2015 15:09:00 +0000</pubDate><atom:updated>2015-02-12T07:09:38.832-08:00</atom:updated><title>ExtJS 5.1 Paging Tool bar example, Pagination for Grid, Ext.PagingToolbar bug in &#39;change&#39; event, Bug in PagingToolbar, Extjs 5 grid binding after page change, Bug when you enter undefined page number</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Here I am going to show one very basic example for Pagination (Paging Tool Bar), along with one very basic issue fixed.&lt;br /&gt;
&lt;br /&gt;
Bug is there in Extjs 5.1 that if you go last page of your grid and enter some page number that is not exist then page number does not refresh to last page number.&lt;br /&gt;
&lt;br /&gt;
First code Demo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&quot;en&quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;meta charset=&quot;UTF-8&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;ExtJS 5.1.0 Grid Pagination Example&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;link rel=&quot;stylesheet&quot; href=&quot;extjs-5.1.0/packages/ext-theme-gray/build/resources/ext-theme-gray-all.css&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;extjs-5.1.0/extjs5.1.0-all-dashboard.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;style&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;.x-grid-item-selected .x-grid-cell {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;background-color: #B3D4FF !important;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;color :#000000 !important;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.onReady(function(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; Ext.define(&#39;Student&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;extend: &#39;Ext.data.Model&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;fields:[{name: &#39;id&#39;},{name: &#39;name&#39;},{name: &#39;mobile&#39;} ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var mydata = {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &quot;success&quot;:true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &quot;totalCount&quot;: 24,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &quot;rows&quot;:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:1, name:&#39;Binod&#39;, mobile:&#39;0000099257&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:2, name:&#39;Binod 2&#39;, mobile:&#39;0000099257&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:3, name:&#39;Akshu&#39;, mobile:&#39;12345070277&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:4, name:&#39;Sanjay 4&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:5, name:&#39;Sanjay 5&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:6, name:&#39;Sanjay 6&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:7, name:&#39;Sanjay 7&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:8, name:&#39;Sanjay 8&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:9, name:&#39;Sanjay 9&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:10, name:&#39;Sanjay 10&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:11, name:&#39;Sanjay 11&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:12, name:&#39;Sanjay 12&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:13, name:&#39;Sanjay 13 &#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:14, name:&#39;Sanjay 14&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:15, name:&#39;Sanjay 15&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:16, name:&#39;Sanjay 16&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:17, name:&#39;Sanjay 17&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:18, name:&#39;Sanjay 18&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:19, name:&#39;Sanjay 19&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:20, name:&#39;Sanjay 20&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:21, name:&#39;Sanjay 21&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:22, name:&#39;Sanjay 22&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:23, name:&#39;Sanjay 23&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:24, name:&#39;Zambia 24&#39;, mobile:&#39;8888999997&#39;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var storeProxy = {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type: &#39;memory&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; &amp;nbsp;enablePaging : true,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data: mydata&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; storeProxy.reader = {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type: &#39;json&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;totalProperty: &#39;totalCount&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;rootProperty: &#39;rows&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;successProperty: &#39;success&#39;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp;var studentStore = Ext.create(&#39;Ext.data.Store&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;model: &#39;Student&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;autoLoad: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;remoteSort: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;remoteFilter : true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;pageSize: 10,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;proxy: storeProxy&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var dockedPagingToolbar = [];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dockedPagingToolbar = [{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xtype: &#39;pagingtoolbar&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; store: studentStore, &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dock: &#39;bottom&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; displayInfo: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &lt;b&gt;&amp;nbsp; readPageFromInput : function(pageData){&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;var inputItem = this.getInputItem(),&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;pageNum = false,&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;v;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (inputItem) {&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;v = inputItem.getValue();&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;pageNum = parseInt(v, 10);&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;&amp;nbsp;&lt;/b&gt;&lt;b&gt;if(pageNum &amp;gt; pageData.pageCount){&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt; inputItem.setValue(pageData.pageCount);&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;}&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;if (!v || isNaN(pageNum)) {&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;inputItem.setValue(pageData.currentPage);&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;return false;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;}&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;}&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;return pageNum;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.create(&#39;Ext.grid.Panel&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;renderTo: Ext.getBody(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;store: studentStore,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;width: 450,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 250,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 290,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;multiSelect: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;title: &#39;Student Records&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;plugins: &#39;gridfilters&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; dockedItems : dockedPagingToolbar,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;columns:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {xtype: &#39;checkcolumn&#39;, text: &#39;Status&#39;, filter: &#39;string&#39;, dataIndex:&#39;status&#39;, width: 50},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Roll Number&#39;, filter: &#39;numeric&#39;, dataIndex:&#39;id&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Name&#39; , filter: &#39;string&#39;,dataIndex:&#39;name&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Mobile&#39; , filter: &#39;string&#39;,dataIndex:&#39;mobile&#39;, flex: 1}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}); &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solution of that bug:&lt;br /&gt;
You have to override the paging.js&amp;nbsp;&amp;nbsp;readPageFromInput method to add fix of that bug. Please see the bold method in above code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2015/02/extjs-51-paging-tool-bar-example.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-3709125895412548869</guid><pubDate>Thu, 12 Feb 2015 14:45:00 +0000</pubDate><atom:updated>2015-02-12T06:45:27.582-08:00</atom:updated><title>Extjs 5.1 ContextMenu Example, Menu not hiding if menu item is never focused, Context Menu issue, Right click menu not closing after clicking on other row</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Very basic example with running code for ContextMenu with menu action on ExtJS 5.1.0&lt;br /&gt;
Along with one workaround solution for a bug that is there in Extjs 5.1. Bug is:&lt;br /&gt;
If you right click on any row then you will get context menu, now if you click on any other row that context menu does not go off, still showing.&lt;br /&gt;
&lt;br /&gt;
First Code Example for Context Menu in ExtJS 5.1.0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&quot;en&quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;meta charset=&quot;UTF-8&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;ExtJS 5 Context Menu&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;extjs-5.1.0/packages/ext-theme-gray/build/resources/ext-theme-gray-all.css&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;extjs-5.1.0/extjs5.1.0-all-dashboard.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;style&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;.x-grid-item-selected .x-grid-cell {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;background-color: #B3D4FF !important;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;color :#000000 !important;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var resultGrid = null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.onReady(function(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;Ext.define(&#39;Student&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;extend: &#39;Ext.data.Model&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;fields:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; {name: &#39;id&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; {name: &#39;name&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; {name: &#39;mobile&#39;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var studentStore = Ext.create(&#39;Ext.data.Store&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; model: &#39;Student&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;pageSize: 7,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; data:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;1&#39;, name:&#39;Binod&#39;, mobile:&#39;9900999000&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;5&#39;, name:&#39;Ben&#39;, mobile:&#39;9902899999000&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;3&#39;, name:&#39;Sergei&#39;, mobile:&#39;903599999000&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;4&#39;, name:&#39;Steve 4&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;5&#39;, name:&#39;Adam 5&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;6&#39;, name:&#39;Matt 6&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;7&#39;, name:&#39;Huge 7&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;8&#39;, name:&#39;McDonald 8&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;9&#39;, name:&#39;Prasad&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;10&#39;, name:&#39;Pramod&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;11&#39;, name:&#39;Arnab&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;12&#39;, name:&#39;Soumya&#39;, mobile:&#39;999988885&#39;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;this.resultGrid = Ext.create(&#39;bin.com.ResultGrid&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; renderTo: Ext.getBody(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; store: studentStore,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; listeners: {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; itemcontextmenu: &#39;forContextMenu&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var showRoll = function(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;var allSelectedRecord = resultGrid.getView().selModel.getSelection();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; alert(&quot;Roll : &quot;+allSelectedRecord[0].get(&#39;id&#39;));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var showSelectedRecord = &amp;nbsp;function(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;var allSelectedRecord = resultGrid.getView().selModel.getSelection();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;alert(&quot;Name : &quot;+allSelectedRecord[0].get(&#39;name&#39;)+&quot;\n&quot;+&quot;Mobile :&quot;+allSelectedRecord[0].get(&#39;mobile&#39;));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var resultGrid = Ext.define(&#39;bin.com.ResultGrid&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;extend: &#39;Ext.grid.Panel&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;width: 400,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 200,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;title: &#39;Student Records&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;plugins: &#39;gridfilters&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;columns:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Roll Number&#39;, filter: &#39;string&#39;, dataIndex:&#39;id&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Name&#39; , filter: &#39;string&#39;,dataIndex:&#39;name&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Mobile&#39; , filter: &#39;string&#39;,dataIndex:&#39;mobile&#39;, flex: 1}&lt;br /&gt;
&amp;nbsp; ],&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;forContextMenu : function(view, record, node, index, e) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; e.stopEvent();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;gridContextMenu.showAt(e.getXY());&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;},&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;initComponent: function () {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;this.selModel = new Ext.selection.CheckboxModel( {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;this.callParent(arguments);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}); &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var gridContextMenu = Ext.create(&#39;Ext.menu.Menu&#39;, {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;margin: &#39;0 0 10 0&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; items: [{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp;text: &#39;Show Details&#39;,&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;handler : showSelectedRecord&lt;br /&gt;
&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp;text: &#39;Show Roll&#39;,&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;handler : showRoll&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}],&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;b&gt;listeners: {&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mouseleave: function() {&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gridContextMenu.hide();&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/b&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; });&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2015/02/extjs-51-contextmenu-example-menu-not.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-1932228014787296994</guid><pubDate>Sun, 01 Feb 2015 18:36:00 +0000</pubDate><atom:updated>2015-02-01T10:36:56.600-08:00</atom:updated><title>Java BigInteger Example How to use BigInteger Factorial of large data Convert int to BigInteger and BigInteger to int</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: blue; font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;b&gt;BigInteger:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;All most all number data type in Java has some limit but what you will do if you have to do some calculation on big data like calculate factorial of 100 or 500 :)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;There is no theoretical limit. The BigInteger class allocates as much memory as it needs to hold all the bits of data it is asked to hold.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;If you are working with values that cannot fit into a long or a double then you will need to use a reference type like BigInteger.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;It does not support addition by + like other number datatype in java. For that addition you have to call add() method.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 19px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;You can use bigInteger for int, long, double etc.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #555555; font-family: monospace; font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html&quot; style=&quot;font-family: monospace; font-size: 14px; line-height: 19px;&quot; target=&quot;_blank&quot;&gt;Please check this document link&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #555555; font-family: monospace; font-size: 14px; line-height: 19px;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 19px;&quot;&gt;Convert from int to BigInteger&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 19px;&quot;&gt;BigInteger newdata =&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;BigInteger.valueOf(20);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;Convert from BigInteger to int&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;int intdata = newdata.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Consolas, &#39;Courier New&#39;, Courier, mono, serif; font-size: 12px; line-height: 14px;&quot;&gt;intMax.intValue()); &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Consolas, &#39;Courier New&#39;, Courier, mono, serif; font-size: 12px; line-height: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: Consolas, &#39;Courier New&#39;, Courier, mono, serif; font-size: 12px; line-height: 14px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Factorial example for big data:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;background-color: white; font-family: Consolas, &#39;Courier New&#39;, Courier, mono, serif; font-size: 12px; line-height: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;import java.util.Date;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;import static java.lang.System.out; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;import java.math.BigInteger;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;public class BigFactorial {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 12px; line-height: 14px; white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;&amp;nbsp;public static void main(String[] args) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;BigFactorial heck = new BigFactorial();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;System.out.println(heck.fact(BigInteger.valueOf(500)));&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 12px; line-height: 14px; white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;private BigInteger fact(BigInteger n){&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp;if(n==BigInteger.valueOf(0) || n==BigInteger.valueOf(1) )return BigInteger.valueOf(1);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp;else{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;return n.multiply(fact(n.subtract(BigInteger.valueOf(1))));&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 12px; line-height: 14px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Consolas, Courier New, Courier, mono, serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 14px;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #555555; font-family: monospace;&quot;&gt;&lt;span style=&quot;background-color: white; font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2015/02/java-biginteger-example-how-to-use.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-8684367965250289440</guid><pubDate>Fri, 30 Jan 2015 09:23:00 +0000</pubDate><atom:updated>2015-01-30T01:23:31.878-08:00</atom:updated><title>Extjs 5.1.0 how to Change grid panel row select color by cls. Ext Js 5 gridPanel selected row color, ExtJS 5.x Gridpanel Example with CheckboxModel</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In Extjs 5.1 this below is CLS class for selected row in GridPanel&lt;br /&gt;
.x-grid-item-selected .x-grid-cell&lt;br /&gt;
&lt;br /&gt;
You can override this cls for your customization for row selected cls.&lt;br /&gt;
&lt;br /&gt;
Full Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&quot;en&quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;meta charset=&quot;UTF-8&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;ExtJS 5 Grid Example&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;extjs-5.1.0/packages/ext-theme-gray/build/resources/ext-theme-gray-all.css&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;extjs-5.1.0/extjs5.1.0-all-dashboard.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;style&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;.x-grid-item-selected .x-grid-cell {&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;background-color: #B3D4FF !important;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;color :#000000 !important;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.onReady(function(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;Ext.define(&#39;Student&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;extend: &#39;Ext.data.Model&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;fields:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; {name: &#39;id&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; {name: &#39;name&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; {name: &#39;mobile&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; {name: &#39;TestColumn&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; convert : function(value, record){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; return record.get(&#39;name&#39;)+&quot; CHECK&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; }&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var studentStore = Ext.create(&#39;Ext.data.Store&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; model: &#39;Student&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;pageSize: 7,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; data:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;1&#39;, name:&#39;Binod&#39;, mobile:&#39;99999999999&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;5&#39;, name:&#39;Ishan&#39;, mobile:&#39;99898989898&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;3&#39;, name:&#39;Akshu&#39;, mobile:&#39;99999999999&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;4&#39;, name:&#39;Sanjay 4&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;5&#39;, name:&#39;Sanjay 5&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;6&#39;, name:&#39;Sanjay 6&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;7&#39;, name:&#39;Sanjay 7&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;8&#39;, name:&#39;Sanjay 8&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;9&#39;, name:&#39;Sanjay 9&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;10&#39;, name:&#39;Sanjay 10&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;11&#39;, name:&#39;Sanjay 11&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;12&#39;, name:&#39;Sanjay 12&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;13&#39;, name:&#39;Sanjay 13 &#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;14&#39;, name:&#39;Sanjay 14&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;15&#39;, name:&#39;Sanjay 15&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;16&#39;, name:&#39;Sanjay 16&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;17&#39;, name:&#39;Sanjay 17&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;18&#39;, name:&#39;Sanjay 18&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;19&#39;, name:&#39;Sanjay 19&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;20&#39;, name:&#39;Sanjay 20&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;21&#39;, name:&#39;Sanjay 21&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;22&#39;, name:&#39;Sanjay 22&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;23&#39;, name:&#39;Sanjay 23&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {id:&#39;24&#39;, name:&#39;Zambia 24&#39;, mobile:&#39;8888999997&#39;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.create(&#39;bin.com.ResultGrid&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; renderTo: Ext.getBody(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; store: studentStore&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.define(&#39;bin.com.ResultGrid&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;extend: &#39;Ext.grid.Panel&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;width: 600,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 200,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;title: &#39;Student Records&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;plugins: &#39;gridfilters&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;columns:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Roll Number&#39;, filter: &#39;string&#39;, dataIndex:&#39;id&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Name&#39; , filter: &#39;string&#39;,dataIndex:&#39;name&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Mobile&#39; , filter: &#39;string&#39;,dataIndex:&#39;mobile&#39;, flex: 1},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Test Column&#39; , filter: &#39;string&#39;,dataIndex:&#39;TestColumn&#39;, flex: 1},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;],&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;initComponent: function () {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;this.selModel = new Ext.selection.CheckboxModel( {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;this.callParent(arguments);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}); &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2015/01/extjs-510-how-to-change-grid-panel-row.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-5627146658541169175</guid><pubDate>Mon, 26 Jan 2015 15:34:00 +0000</pubDate><atom:updated>2015-01-26T07:34:38.614-08:00</atom:updated><title>Ext js 5.1 tutorial, ExtJS GridPanel example getting start, pagingmemory in ExtJS 5.1, ext.data.proxy.memory read method </title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
When you migrate from ExtJS 4 to 5 then you will find out that lot of things in GridPanel has been changed. If you have implemented &quot;pagingmemor&quot; in ExtJS 4.x then it will not work in ExtJS 5.1, cause Ext.data.proxy.Memory&#39;s read method has been changed, earlier there were three arguments were passed and this time only one &#39;operation&#39; is there. Due to absence of &#39;scope&#39; and &#39;callback&#39; your &#39;&lt;a class=&quot;docClass&quot; href=&quot;http://docs.sencha.com/extjs/5.1/5.1.0-apidocs/#!/api/Ext.ux.data.PagingMemoryProxy&quot; rel=&quot;Ext.ux.data.PagingMemoryProxy&quot; style=&quot;background-color: #f7f7f7; box-sizing: border-box; color: #083772; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace; font-size: 12px; line-height: 12px; text-decoration: none; white-space: pre;&quot;&gt;Ext.ux.data.PagingMemoryProxy&lt;/a&gt;.js&#39; will not work and this is important JS for local memory sorting, filtering and pagination.&lt;br /&gt;
&lt;br /&gt;
ExtJS 5.1 came up with new configruation in &#39;&lt;strong style=&quot;background-color: #f7f7f7; box-sizing: border-box; color: #484848; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace; font-size: 12px; line-height: 12px; white-space: pre;&quot;&gt;Ext.data.proxy.Memory&lt;/strong&gt;&#39; and that is &#39;&lt;a class=&quot;name expandable&quot; href=&quot;http://docs.sencha.com/extjs/5.1/5.1.0-apidocs/#!/api/Ext.data.proxy.Memory-cfg-enablePaging&quot; style=&quot;background-color: white; box-sizing: border-box; color: #083772; font-family: HelveticaNeue, helvetica, arial, clean, sans-serif; font-size: 13px; font-weight: bold; line-height: 19.5px; text-decoration: none;&quot;&gt;enablePaging&lt;/a&gt;&#39; .&lt;br /&gt;
You do not need to do any thing for local memory pagination, just set this configuration true. That is.&lt;br /&gt;
&lt;br /&gt;
Below is the full example of this configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&quot;en&quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;meta charset=&quot;UTF-8&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;ExtJS 5.1.0 Grid Pagination Example&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;link rel=&quot;stylesheet&quot; href=&quot;extjs-5.1.0/packages/ext-theme-gray/build/resources/ext-theme-gray-all.css&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;extjs-5.1.0/extjs5.1.0-all-dashboard.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.onReady(function(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; Ext.define(&#39;Student&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;extend: &#39;Ext.data.Model&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;fields:[{name: &#39;id&#39;},{name: &#39;name&#39;},{name: &#39;mobile&#39;} ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var mydata = {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &quot;success&quot;:true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &quot;totalCount&quot;: 24,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &quot;rows&quot;:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:1, name:&#39;Binod&#39;, mobile:&#39;0000099257&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:2, name:&#39;Binod 2&#39;, mobile:&#39;0000099257&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:3, name:&#39;Akshu&#39;, mobile:&#39;12345070277&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:4, name:&#39;Sanjay 4&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:5, name:&#39;Sanjay 5&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:6, name:&#39;Sanjay 6&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:7, name:&#39;Sanjay 7&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:8, name:&#39;Sanjay 8&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:9, name:&#39;Sanjay 9&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:10, name:&#39;Sanjay 10&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:11, name:&#39;Sanjay 11&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:12, name:&#39;Sanjay 12&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:13, name:&#39;Sanjay 13 &#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:14, name:&#39;Sanjay 14&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:15, name:&#39;Sanjay 15&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:16, name:&#39;Sanjay 16&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:17, name:&#39;Sanjay 17&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:18, name:&#39;Sanjay 18&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:19, name:&#39;Sanjay 19&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:20, name:&#39;Sanjay 20&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:21, name:&#39;Sanjay 21&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:22, name:&#39;Sanjay 22&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:23, name:&#39;Sanjay 23&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:24, name:&#39;Zambia 24&#39;, mobile:&#39;8888999997&#39;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var storeProxy = {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type: &#39;memory&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; &amp;nbsp;enablePaging : true,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data: mydata&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;storeProxy.reader = {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type: &#39;json&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;totalProperty: &#39;totalCount&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;rootProperty: &#39;rows&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;successProperty: &#39;success&#39;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp;var studentStore = Ext.create(&#39;Ext.data.Store&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;model: &#39;Student&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;autoLoad: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;remoteSort: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;remoteFilter : true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;pageSize: 10,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;proxy: storeProxy&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var dockedPagingToolbar = [];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dockedPagingToolbar = [{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xtype: &#39;pagingtoolbar&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; store: studentStore, &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dock: &#39;bottom&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; displayInfo: true&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.create(&#39;Ext.grid.Panel&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;renderTo: Ext.getBody(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;store: studentStore,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;width: 450,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 250,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 290,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;multiSelect: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;title: &#39;Student Records&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;plugins: &#39;gridfilters&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; dockedItems : dockedPagingToolbar,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;columns:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {xtype: &#39;checkcolumn&#39;, text: &#39;Status&#39;, filter: &#39;string&#39;, dataIndex:&#39;status&#39;, width: 50},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Roll Number&#39;, filter: &#39;numeric&#39;, dataIndex:&#39;id&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Name&#39; , filter: &#39;string&#39;,dataIndex:&#39;name&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Mobile&#39; , filter: &#39;string&#39;,dataIndex:&#39;mobile&#39;, flex: 1}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}); &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2015/01/ext-js-51-tutorial-extjs-gridpanel.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-3624269821778099151</guid><pubDate>Sun, 25 Jan 2015 03:47:00 +0000</pubDate><atom:updated>2015-01-26T07:37:07.704-08:00</atom:updated><title>extjs 5.1.0 pagingmemory example extjs 5.1.0 pagingmemory alternative Ext JS GridPanel, sorting, filtering, pagination on local data</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&amp;nbsp;pagingmemory config was working very fine till Ext JS 4 BUT it seems some issue is there in Ext JS 5. So we can not use&amp;nbsp;pagingmemory directly, in stead we have to manually handle data from pagination. It is easy and just one line code, take page start and limit value and slice your actual data and send back to store proxy data variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Two thinks &amp;nbsp;keep in mind for below example:&lt;br /&gt;
1. In storeProxy, added new config name is actualData where you have to assign your complete data fetch from back end.&lt;br /&gt;
&lt;br /&gt;
2. storeProxy.reader.rootProperty value I used in manually hardword &quot;rows&quot; in slice method where I cut data for current page.&lt;br /&gt;
&lt;br /&gt;
Please just copy and paste below code (change extjs css and js file path accordginly), it work perfectly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&quot;en&quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;meta charset=&quot;UTF-8&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;ExtJS 5.1.0 Grid Pagination Example&amp;lt;/title&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;link rel=&quot;stylesheet&quot; href=&quot;extjs-5.1.0/packages/ext-theme-gray/build/resources/ext-theme-gray-all.css&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;extjs-5.1.0/extjs5.1.0-all-dashboard.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;script src=&quot;extjs-5.1.0/examples/ux/data/NOCPagingMemoryProxy.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.onReady(function(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; Ext.define(&#39;Student&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;extend: &#39;Ext.data.Model&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;fields:[{name: &#39;id&#39;},{name: &#39;name&#39;},{name: &#39;mobile&#39;} ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var mydata = {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &quot;success&quot;:true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &quot;totalCount&quot;: 24,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &quot;rows&quot;:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:1, name:&#39;Binod&#39;, mobile:&#39;0000099257&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:2, name:&#39;Binod 2&#39;, mobile:&#39;0000099257&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:3, name:&#39;Akshu&#39;, mobile:&#39;12345070277&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:4, name:&#39;Sanjay 4&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:5, name:&#39;Sanjay 5&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:6, name:&#39;Sanjay 6&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:7, name:&#39;Sanjay 7&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:8, name:&#39;Sanjay 8&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:9, name:&#39;Sanjay 9&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:10, name:&#39;Sanjay 10&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:11, name:&#39;Sanjay 11&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:12, name:&#39;Sanjay 12&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:13, name:&#39;Sanjay 13 &#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:14, name:&#39;Sanjay 14&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:15, name:&#39;Sanjay 15&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:16, name:&#39;Sanjay 16&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:17, name:&#39;Sanjay 17&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:18, name:&#39;Sanjay 18&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:19, name:&#39;Sanjay 19&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:20, name:&#39;Sanjay 20&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:21, name:&#39;Sanjay 21&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:22, name:&#39;Sanjay 22&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:23, name:&#39;Sanjay 23&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:24, name:&#39;Zambia 24&#39;, mobile:&#39;8888999997&#39;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var storeProxy = {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type: &#39;memory&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt; &amp;nbsp;actualdata: mydata,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data: mydata&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;//storeProxy.type = &#39;pagingmemory&#39;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;storeProxy.reader = {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type: &#39;json&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;totalProperty: &#39;totalCount&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;rootProperty: &#39;rows&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;successProperty: &#39;success&#39;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp;var studentStore = Ext.create(&#39;Ext.data.Store&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;model: &#39;Student&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;autoLoad: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;remoteSort: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;remoteFilter : true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;pageSize: 10,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;proxy: storeProxy,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;listeners: {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;beforeload : function(store, operation, eOpts){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if (operation._start !== undefined &amp;amp;&amp;amp; operation._limit !== undefined) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;// Here you have to manually handle data for requested page as pagingmemory not working.&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp;store.proxy.data.rows = store.proxy.actualdata.rows.slice(operation._start, operation._start + operation._limit);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var dockedPagingToolbar = [];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dockedPagingToolbar = [{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xtype: &#39;pagingtoolbar&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; store: studentStore, &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dock: &#39;bottom&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; displayInfo: true&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.create(&#39;Ext.grid.Panel&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;renderTo: Ext.getBody(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;store: studentStore,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;width: 450,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 250,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 290,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;multiSelect: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;title: &#39;Student Records&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;plugins: &#39;gridfilters&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; dockedItems : dockedPagingToolbar,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;columns:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {xtype: &#39;checkcolumn&#39;, text: &#39;Status&#39;, filter: &#39;string&#39;, dataIndex:&#39;status&#39;, width: 50},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Roll Number&#39;, filter: &#39;string&#39;, dataIndex:&#39;id&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Name&#39; , filter: &#39;string&#39;,dataIndex:&#39;name&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Mobile&#39; , filter: &#39;string&#39;,dataIndex:&#39;mobile&#39;, flex: 1}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}); &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; // studentStore.loadPage(1);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://binodsuman.blogspot.in/2015/01/ext-js-51-tutorial-extjs-gridpanel.html&quot; target=&quot;_blank&quot;&gt;Please refer this link blog for better example on Extjs 5.1 without using any hard coded data.&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2015/01/extjs-510-pagingmemory-example-extjs.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-6521426159790559772</guid><pubDate>Sat, 24 Jan 2015 17:50:00 +0000</pubDate><atom:updated>2015-01-24T09:50:17.364-08:00</atom:updated><title>Extjs Pagination, pagingmemory Example, Extjs 4.1.0 Grid Panel with Sorting and Pagination on local memory</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&quot;en&quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;meta charset=&quot;UTF-8&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;ExtJS 4.1. Grid Pagination Example&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;link rel=&quot;stylesheet&quot; href=&quot;ext-4.2.1.883\packages\ext-theme-gray\build\resources\ext-theme-gray-all.css&quot;/&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;script src=&quot;ext-4.2.1.883\ext-all.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;script src=&quot;ext-4.2.1.883\examples\ux\data\PagingMemoryProxy.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.onReady(function(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;Ext.define(&#39;Student&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;extend: &#39;Ext.data.Model&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;fields:[{name: &#39;id&#39;},{name: &#39;name&#39;},{name: &#39;mobile&#39;} ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var mydata = {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &quot;success&quot;:true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &quot;totalCount&quot;: 24,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &quot;rows&quot;:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:1, name:&#39;Binod&#39;, mobile:&#39;0000099257&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:5, name:&#39;Ishan&#39;, mobile:&#39;0002887325&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:3, name:&#39;Akshu&#39;, mobile:&#39;12345070277&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:4, name:&#39;Sanjay 4&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:5, name:&#39;Sanjay 5&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:6, name:&#39;Sanjay 6&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:7, name:&#39;Sanjay 7&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:8, name:&#39;Sanjay 8&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:9, name:&#39;Sanjay 9&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:10, name:&#39;Sanjay 10&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:11, name:&#39;Sanjay 11&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:12, name:&#39;Sanjay 12&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:13, name:&#39;Sanjay 13 &#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:14, name:&#39;Sanjay 14&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:15, name:&#39;Sanjay 15&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:16, name:&#39;Sanjay 16&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:17, name:&#39;Sanjay 17&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:18, name:&#39;Sanjay 18&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:19, name:&#39;Sanjay 19&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:20, name:&#39;Sanjay 20&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:21, name:&#39;Sanjay 21&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:22, name:&#39;Sanjay 22&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:23, name:&#39;Sanjay 23&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:24, name:&#39;Zambia 24&#39;, mobile:&#39;8888999997&#39;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var storeProxy = {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type: &#39;memory&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data: mydata&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;storeProxy.type = &#39;pagingmemory&#39;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; storeProxy.reader = {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;type: &#39;json&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;totalProperty: &#39;totalCount&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;root: &#39;rows&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;successProperty: &#39;success&#39;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;};&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var studentStore = Ext.create(&#39;Ext.data.Store&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; model: &#39;Student&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; autoLoad: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; remoteSort: true,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;pageSize: 7,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; proxy: storeProxy&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;studentStore.load();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;var dockedPagingToolbar = [];&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dockedPagingToolbar = [{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xtype: &#39;pagingtoolbar&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; store: studentStore, &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dock: &#39;bottom&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; displayInfo: true&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }];&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.create(&#39;Ext.grid.Panel&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;renderTo: Ext.getBody(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;store: studentStore,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;width: 450,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 250,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 220,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;multiSelect: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;title: &#39;Student Records&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;//plugins: &#39;gridfilters&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; dockedItems : dockedPagingToolbar,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;columns:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {xtype: &#39;checkcolumn&#39;, text: &#39;Status&#39;, dataIndex:&#39;status&#39;, width: 50},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Roll Number&#39;, dataIndex:&#39;id&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Name&#39; , dataIndex:&#39;name&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Mobile&#39; ,dataIndex:&#39;mobile&#39;, flex: 1}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;]&lt;br /&gt;
&amp;nbsp; &amp;nbsp;}); &lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2015/01/extjs-pagination-pagingmemory-example.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-201093609826996053</guid><pubDate>Thu, 22 Jan 2015 17:58:00 +0000</pubDate><atom:updated>2015-01-22T09:58:02.884-08:00</atom:updated><title>Extjs 5.1.0 Ext.data.field.convert example How to perform some processing when we load a Field&#39;s data in Extjs 5.1.0</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; id=&quot;ext-gen1466&quot; style=&quot;background-color: #f7f7f7; border-radius: 5px; border: 1px solid rgb(232, 232, 232); box-sizing: border-box; margin-bottom: 14px; margin-top: 10px; max-width: 900px; overflow-x: auto; overflow-y: hidden; padding: 10px 12px;&quot;&gt;&lt;span style=&quot;font-family: HelveticaNeue, helvetica, arial, clean, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 16.0030002593994px; white-space: normal;&quot;&gt;Some time you feel to create new column in grid based on the existing column like create firstname from given full name or create insertion date.&lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;font-family: HelveticaNeue, helvetica, arial, clean, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 16.0030002593994px; white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: HelveticaNeue, helvetica, arial, clean, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 16.0030002593994px; white-space: normal;&quot;&gt;Sometimes a simple type isn&#39;t enough, or we want to perform some processing when we load a Field&#39;s data. We can do this using a convert function. Here, we&#39;re going to create a new field based on another:&lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;font-family: HelveticaNeue, helvetica, arial, clean, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 16.0030002593994px; white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: HelveticaNeue, helvetica, arial, clean, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 16.0030002593994px; white-space: normal;&quot;&gt;When reading fields it is often necessary to convert the values received before using them or storing them in records. To handle these cases there is the convert method.&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: white; font-family: HelveticaNeue, helvetica, arial, clean, sans-serif; font-size: 13px; line-height: 16.0030002593994px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #484848; font-family: HelveticaNeue, helvetica, arial, clean, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #484848; font-family: HelveticaNeue, helvetica, arial, clean, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;For example 1:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #484848; font-family: HelveticaNeue, helvetica, arial, clean, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot; id=&quot;ext-gen1130&quot; style=&quot;background-color: #f7f7f7; border-radius: 5px; border: 1px solid rgb(232, 232, 232); box-sizing: border-box; color: #314e64; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace; font-size: 13px; line-height: 1.3em; margin-bottom: 14px; margin-top: 10px; overflow-x: auto; overflow-y: hidden; padding: 10px 12px;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace; line-height: 13px; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;pun&quot; id=&quot;ext-gen1136&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; id=&quot;ext-gen1135&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; name&lt;/span&gt;&lt;span class=&quot;pun&quot; id=&quot;ext-gen1134&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; id=&quot;ext-gen1133&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; id=&quot;ext-gen1132&quot; style=&quot;box-sizing: border-box; color: #008800;&quot;&gt;&#39;firstName&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; id=&quot;ext-gen1138&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #000088;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt; record&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; id=&quot;ext-gen1139&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #000088;&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt; fullName &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt; record&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #000088;&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;box-sizing: border-box; color: #008800;&quot;&gt;&#39;name&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot; id=&quot;ext-gen1140&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; splits &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt; fullName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;box-sizing: border-box; color: #008800;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;pln&quot; id=&quot;ext-gen1141&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; firstName &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt; splits&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;box-sizing: border-box; color: #006666;&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;];&lt;/span&gt;&lt;span class=&quot;pln&quot; id=&quot;ext-gen1142&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #000088;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt; firstName&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; id=&quot;ext-gen1143&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #484848; font-family: HelveticaNeue, helvetica, arial, clean, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #484848; font-family: HelveticaNeue, helvetica, arial, clean, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #484848; font-family: HelveticaNeue, helvetica, arial, clean, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;For Example 2:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #484848; font-family: HelveticaNeue, helvetica, arial, clean, sans-serif; font-size: 13px; line-height: 19.5px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; id=&quot;ext-gen1466&quot; style=&quot;background-color: #f7f7f7; border-radius: 5px; border: 1px solid rgb(232, 232, 232); box-sizing: border-box; color: #314e64; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace; font-size: 13px; line-height: 1.3em; margin-bottom: 14px; margin-top: 10px; max-width: 900px; overflow-x: auto; overflow-y: hidden; padding: 10px 12px;&quot;&gt;&lt;code id=&quot;ext-gen1467&quot; style=&quot;box-sizing: border-box; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace; font-style: inherit; font-weight: inherit; line-height: 13px; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;
     name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;box-sizing: border-box; color: #008800;&quot;&gt;&#39;timestamp&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;

     convert&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #000088;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #000088;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;box-sizing: border-box; color: #000088;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;box-sizing: border-box; color: #660066;&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;
     &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;box-sizing: border-box; color: black;&quot;&gt;
 &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; id=&quot;ext-gen1466&quot; style=&quot;background-color: #f7f7f7; border-radius: 5px; border: 1px solid rgb(232, 232, 232); box-sizing: border-box; color: #314e64; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace; font-size: 13px; line-height: 1.3em; margin-bottom: 14px; margin-top: 10px; max-width: 900px; overflow-x: auto; overflow-y: hidden; padding: 10px 12px;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace; font-style: inherit; font-weight: inherit; line-height: 13px; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; id=&quot;ext-gen1466&quot; style=&quot;background-color: #f7f7f7; border-radius: 5px; border: 1px solid rgb(232, 232, 232); box-sizing: border-box; color: #314e64; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace; font-size: 13px; line-height: 1.3em; margin-bottom: 14px; margin-top: 10px; max-width: 900px; overflow-x: auto; overflow-y: hidden; padding: 10px 12px;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace; font-style: inherit; font-weight: inherit; line-height: 13px; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; id=&quot;ext-gen1466&quot; style=&quot;background-color: #f7f7f7; border-radius: 5px; border: 1px solid rgb(232, 232, 232); box-sizing: border-box; color: #314e64; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace; font-size: 13px; line-height: 1.3em; margin-bottom: 14px; margin-top: 10px; max-width: 900px; overflow-x: auto; overflow-y: hidden; padding: 10px 12px;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace; font-style: inherit; font-weight: inherit; line-height: 13px; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;Complete Example:&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; id=&quot;ext-gen1466&quot; style=&quot;background-color: #f7f7f7; border-radius: 5px; border: 1px solid rgb(232, 232, 232); box-sizing: border-box; color: #314e64; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace; font-size: 13px; line-height: 1.3em; margin-bottom: 14px; margin-top: 10px; max-width: 900px; overflow-x: auto; overflow-y: hidden; padding: 10px 12px;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace; font-style: inherit; font-weight: inherit; line-height: 13px; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; id=&quot;ext-gen1466&quot; style=&quot;background-color: #f7f7f7; border-radius: 5px; border: 1px solid rgb(232, 232, 232); box-sizing: border-box; margin-bottom: 14px; margin-top: 10px; max-width: 900px; overflow-x: auto; overflow-y: hidden; padding: 10px 12px;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; line-height: 13px;&quot;&gt;&lt;span style=&quot;color: #666600; font-family: Menlo, Courier New, Courier, monospace;&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang=&quot;en&quot;&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset=&quot;UTF-8&quot;/&amp;gt;
    &amp;lt;title&amp;gt;ExtJS Grid Example&amp;lt;/title&amp;gt;
    &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;extjs-5.1.0/packages/ext-theme-gray/build/resources/ext-theme-gray-all.css&quot;/&amp;gt;
    &amp;lt;script src=&quot;extjs-5.1.0/extjs5.1.0-all-dashboard.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; id=&quot;ext-gen1466&quot; style=&quot;background-color: #f7f7f7; border-radius: 5px; border: 1px solid rgb(232, 232, 232); box-sizing: border-box; margin-bottom: 14px; margin-top: 10px; max-width: 900px; overflow-x: auto; overflow-y: hidden; padding: 10px 12px;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; color: #666600; font-family: Menlo, Courier New, Courier, monospace; line-height: 13px;&quot;&gt;Ext.onReady(function(){
   
   Ext.define(&#39;Student&#39;,{
   extend: &#39;Ext.data.Model&#39;,
   fields:[
    {name: &#39;id&#39;},
    {name: &#39;name&#39;},
    {name: &#39;mobile&#39;},
    {name: &#39;TestColumn&#39;,
     convert : function(value, record){
    return record.get(&#39;name&#39;)+&quot; CHECK&quot;;
  }
     
    }
   ]
   });
 
    var studentStore = Ext.create(&#39;Ext.data.Store&#39;,{
  model: &#39;Student&#39;,
  autoLoad: true,
  data:[
  {status: true, id:&#39;1&#39;, name:&#39;Binod&#39;, mobile:&#39;9900159257&#39;},
  {status: false, id:&#39;5&#39;, name:&#39;Ishan&#39;, mobile:&#39;9902887325&#39;},
  {status: true, id:&#39;3&#39;, name:&#39;Akshu&#39;, mobile:&#39;90351070277&#39;},
  {status: false, id:&#39;4&#39;, name:&#39;Sanjay&#39;, mobile:&#39;999988885&#39;},
  {status: true, id:&#39;2&#39;, name:&#39;Zambia&#39;, mobile:&#39;8888999997&#39;}
  ]
 
 }); 
   
  var selectionchangefired = false;
 
 Ext.create(&#39;Ext.grid.Panel&#39;,{
 renderTo: Ext.getBody(),
 store: studentStore,
 width: 450,
 height: 200,
 multiSelect: true,
 title: &#39;Student Records&#39;,
 plugins: &#39;gridfilters&#39;,
 
 columns:[
  {xtype: &#39;checkcolumn&#39;, text: &#39;Status&#39;, filter: &#39;string&#39;, dataIndex:&#39;status&#39;, width: 50},
  {text: &#39;Roll Number&#39;, filter: &#39;string&#39;, dataIndex:&#39;id&#39;, width: 100},
  {text: &#39;Name&#39; , filter: &#39;string&#39;,dataIndex:&#39;name&#39;, width: 100},
  {text: &#39;Mobile&#39; , filter: &#39;string&#39;,dataIndex:&#39;mobile&#39;, flex: 1},
  {text: &#39;Test Column&#39; , filter: &#39;string&#39;,dataIndex:&#39;TestColumn&#39;, flex: 1},
  
 ],
 
 
 
 dockedItems: [{
        xtype: &#39;pagingtoolbar&#39;,
        store: studentStore,   // same store GridPanel is using
        dock: &#39;bottom&#39;,
        displayInfo: true
    }]
 
 
 
 });  
   
   
 });
  &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; id=&quot;ext-gen1466&quot; style=&quot;background-color: #f7f7f7; border-radius: 5px; border: 1px solid rgb(232, 232, 232); box-sizing: border-box; margin-bottom: 14px; margin-top: 10px; max-width: 900px; overflow-x: auto; overflow-y: hidden; padding: 10px 12px;&quot;&gt;&lt;span style=&quot;color: #666600; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; id=&quot;ext-gen1466&quot; style=&quot;background-color: #f7f7f7; border-radius: 5px; border: 1px solid rgb(232, 232, 232); box-sizing: border-box; margin-bottom: 14px; margin-top: 10px; max-width: 900px; overflow-x: auto; overflow-y: hidden; padding: 10px 12px;&quot;&gt;&lt;span style=&quot;color: #666600; font-family: Menlo, &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp;&amp;lt;/script&amp;gt;
 &amp;lt;/head&amp;gt;
 &amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot; id=&quot;ext-gen1466&quot; style=&quot;background-color: #f7f7f7; border-radius: 5px; border: 1px solid rgb(232, 232, 232); box-sizing: border-box; margin-bottom: 14px; margin-top: 10px; max-width: 900px; overflow-x: auto; overflow-y: hidden; padding: 10px 12px;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; margin: 0px; padding: 0px;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;box-sizing: border-box; line-height: 13px;&quot;&gt;&lt;span style=&quot;color: #666600; font-family: Menlo, Courier New, Courier, monospace;&quot;&gt;Here, Test column is generated during run time based on other field.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2015/01/extjs-510-extdatafieldconvert-example.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-4243371349255028013</guid><pubDate>Thu, 15 Jan 2015 12:19:00 +0000</pubDate><atom:updated>2015-01-15T04:19:12.025-08:00</atom:updated><title>Extjs 5.1.0 Checkbox of GridPanel deselect event not working. checkboxmodel deselect not working</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
I think, this is a bug in Extjs 5.1.0 for&amp;nbsp;CheckboxModel selectionchange doesn&#39;t fire when unselect rows.&lt;br /&gt;
&lt;br /&gt;
Add below code where you define selModel:&lt;br /&gt;
&lt;br /&gt;
selectWithEventMulti: function(record, e, isSelected) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var me = this;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!e.shiftKey &amp;amp;&amp;amp; !e.ctrlKey &amp;amp;&amp;amp; e.getTarget(me.checkSelector)) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (isSelected) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; me.doDeselect(record); // Second param here is suppress event, not &quot;keep selection&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; me.doSelect(record, true);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; me.callParent([record, e, isSelected]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
After adding this above code, your selModel should be like this:&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; this.selModel = new Ext.selection.CheckboxModel( {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;allowDeselect: true,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;checkOnly: false,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pruneRemoved: false,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ignoreRightMouseSelection: true,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;injectCheckbox: 0,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; // ** Newly added code to fix bug&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; selectWithEventMulti: function(record, e, isSelected) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var me = this;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!e.shiftKey &amp;amp;&amp;amp; !e.ctrlKey &amp;amp;&amp;amp; e.getTarget(me.checkSelector)) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (isSelected) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; me.doDeselect(record); // Second param here is suppress event, not &quot;keep selection&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; me.doSelect(record, true);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; me.callParent([record, e, isSelected]);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// *************************&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; showHeaderCheckbox: true,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;listeners: {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; deselect: function( obj, record, index, eOpts ) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert(&quot;check box deselect&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; select: function( obj, record, index, eOpts ) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert(&quot;check box select&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;br /&gt;
&lt;br /&gt;
Reference:&amp;nbsp;http://www.sencha.com/forum/showthread.php?295764&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2015/01/extjs-510-checkbox-of-gridpanel.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-1734551708121577101</guid><pubDate>Thu, 15 Jan 2015 09:43:00 +0000</pubDate><atom:updated>2015-01-15T01:43:13.838-08:00</atom:updated><title>Extjs 5.1 GridPanel plugins: &#39;gridfilters&#39; and listeners example</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Example contains multiSelect,&amp;nbsp;plugins,&amp;nbsp;checkchange and grid panel listeners.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&quot;en&quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;meta charset=&quot;UTF-8&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;Extjs 5.1 Grid Panel&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;extjs-5.1.0/packages/ext-theme-gray/build/resources/ext-theme-gray-all.css&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;extjs-5.1.0/extjs5.1.0-all-dashboard.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.onReady(function(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;console.log(&quot;I am ready now&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;Ext.define(&#39;Student&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;extend: &#39;Ext.data.Model&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;fields: [&#39;id&#39;,&#39;name&#39;,&#39;mobile&#39;]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var studentStore = Ext.create(&#39;Ext.data.Store&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; model: &#39;Student&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; autoLoad: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; data:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:&#39;1&#39;, name:&#39;Binod&#39;, mobile:&#39;0000059257&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:&#39;5&#39;, name:&#39;Ishan&#39;, mobile:&#39;0002887325&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:&#39;3&#39;, name:&#39;Akshu&#39;, mobile:&#39;00351070277&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:&#39;4&#39;, name:&#39;Sanjay&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:&#39;2&#39;, name:&#39;Zambia&#39;, mobile:&#39;8888999997&#39;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.create(&#39;Ext.grid.Panel&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;renderTo: Ext.getBody(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;store: studentStore,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;width: 450,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 200,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;multiSelect: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;title: &#39;Student Records&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;plugins: &#39;gridfilters&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;listeners:{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;selectionchange: &#39;rowclickedevent&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;rowclick: &#39;rowevent&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;columns:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; //{xtype: &#39;checkcolumn&#39;, listeners :{check: &#39;checkchangeEvent&#39;},text: &#39;Status&#39;, filter: &#39;string&#39;, dataIndex:&#39;status&#39;, width: 50},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;xtype: &#39;checkcolumn&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;text: &#39;Status&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;dataIndex: &#39;status&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;flex: 1,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;sortable: false,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;listeners:{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;checkchange:function(cc,ix,isChecked){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;alert(&quot;Check box is clicked and value is : &quot;+isChecked);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Roll Number&#39;, filter: &#39;string&#39;, dataIndex:&#39;id&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Name&#39; , filter: &#39;string&#39;,dataIndex:&#39;name&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Mobile&#39; , filter: &#39;string&#39;,dataIndex:&#39;mobile&#39;, flex: 1}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;],&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;dockedItems: [{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xtype: &#39;pagingtoolbar&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; store: studentStore, &amp;nbsp; // same store GridPanel is using&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dock: &#39;bottom&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; displayInfo: true&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }],&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;checkchangeEvent : function( &amp;nbsp;cc,ix,isChecked ){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;alert(&quot;Check box is clicked and value is : &quot;+isChecked);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;rowevent : function(c, record, tr, rowIndex, e, eOpts){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;alert(&quot;row click number :&quot;+record.length);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;rowclickedevent : function(c, selected, eOpts){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;alert(&quot;selectionchange selected number :&quot;+selected.length);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}); &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2015/01/extjs-51-gridpanel-plugins-gridfilters.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-9138726338980492033</guid><pubDate>Thu, 15 Jan 2015 09:26:00 +0000</pubDate><atom:updated>2015-01-15T01:45:04.239-08:00</atom:updated><title>ExtJs 5.1 GridPanel Plugin gridfilters Example Getting Start</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Here we will use plugins: &#39;gridfilters&#39;, for adding filter functionality in GridPanel.&lt;br /&gt;
This plugins: &#39;gridfilters&#39;, is new plugin has been added in ExtJS 5.1 for filter to reduce a lot of codes.&lt;br /&gt;
&lt;br /&gt;
Use this plugins: &#39;gridfilters&#39;, in create/define during Ext.grid.Panel and then add&amp;nbsp;filter: &#39;string&#39;, in each column to get this filter functionality.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&quot;en&quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;meta charset=&quot;UTF-8&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;Extjs 5.1 Grid Panel&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;extjs-5.1.0/packages/ext-theme-gray/build/resources/ext-theme-gray-all.css&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;extjs-5.1.0/extjs5.1.0-all-dashboard.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.onReady(function(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;console.log(&quot;I am ready now&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;Ext.define(&#39;Student&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;extend: &#39;Ext.data.Model&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;fields: [&#39;id&#39;,&#39;name&#39;,&#39;mobile&#39;]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var studentStore = Ext.create(&#39;Ext.data.Store&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; model: &#39;Student&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; autoLoad: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; data:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:&#39;1&#39;, name:&#39;Binod&#39;, mobile:&#39;0000059257&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:&#39;5&#39;, name:&#39;Ishan&#39;, mobile:&#39;0002887325&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:&#39;3&#39;, name:&#39;Akshu&#39;, mobile:&#39;00351070277&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:&#39;4&#39;, name:&#39;Sanjay&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:&#39;2&#39;, name:&#39;Zambia&#39;, mobile:&#39;8888999997&#39;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.create(&#39;Ext.grid.Panel&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;renderTo: Ext.getBody(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;store: studentStore,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;width: 450,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 200,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;title: &#39;Student Records&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;plugins: &#39;gridfilters&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;columns:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {xtype: &#39;checkcolumn&#39;, text: &#39;Status&#39;, filter: &#39;string&#39;, dataIndex:&#39;status&#39;, width: 50},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Roll Number&#39;, filter: &#39;string&#39;, dataIndex:&#39;id&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Name&#39; , filter: &#39;string&#39;,dataIndex:&#39;name&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Mobile&#39; , filter: &#39;string&#39;,dataIndex:&#39;mobile&#39;, flex: 1}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;],&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;dockedItems: [{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xtype: &#39;pagingtoolbar&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; store: studentStore, &amp;nbsp; // same store GridPanel is using&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dock: &#39;bottom&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; displayInfo: true&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}); &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now if you click on any column, you will get filter functionality.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2015/01/extjs-51-gridpanel-plugin-gridfilters.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3939502048416062406.post-627597697512337690</guid><pubDate>Thu, 15 Jan 2015 09:09:00 +0000</pubDate><atom:updated>2015-01-15T01:43:50.442-08:00</atom:updated><title>ExtJs 5.1 GridPanel Basic Example Getting Start</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Found some changed while migrating my product from Extjs 4 5o Extjs 5.1, so thought to share with you all.&lt;br /&gt;
Here below is very basic example of GridPanel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&quot;en&quot;&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;meta charset=&quot;UTF-8&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;Extjs 5.1 Grid Panel&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;link rel=&quot;stylesheet&quot; href=&quot;extjs-5.1.0/packages/ext-theme-gray/build/resources/ext-theme-gray-all.css&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;extjs-5.1.0/extjs5.1.0-all-dashboard.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.onReady(function(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;console.log(&quot;I am ready now&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;Ext.define(&#39;Student&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;extend: &#39;Ext.data.Model&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;fields: [&#39;id&#39;,&#39;name&#39;,&#39;mobile&#39;]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; var studentStore = Ext.create(&#39;Ext.data.Store&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; model: &#39;Student&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; autoLoad: true,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; data:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:&#39;1&#39;, name:&#39;Binod&#39;, mobile:&#39;0000059257&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:&#39;5&#39;, name:&#39;Ishan&#39;, mobile:&#39;0002887325&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:&#39;3&#39;, name:&#39;Akshu&#39;, mobile:&#39;00351070277&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: false, id:&#39;4&#39;, name:&#39;Sanjay&#39;, mobile:&#39;999988885&#39;},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {status: true, id:&#39;2&#39;, name:&#39;Zambia&#39;, mobile:&#39;8888999997&#39;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; ]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Ext.create(&#39;Ext.grid.Panel&#39;,{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;renderTo: Ext.getBody(),&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;store: studentStore,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;width: 450,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;height: 200,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;title: &#39;Student Records&#39;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;columns:[&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {xtype: &#39;checkcolumn&#39;, text: &#39;Status&#39;, dataIndex:&#39;status&#39;, width: 50},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Roll Number&#39;, dataIndex:&#39;id&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Name&#39; , dataIndex:&#39;name&#39;, width: 100},&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; {text: &#39;Mobile&#39; , dataIndex:&#39;mobile&#39;, flex: 1}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;],&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;dockedItems: [{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xtype: &#39;pagingtoolbar&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; store: studentStore, &amp;nbsp; // same store GridPanel is using&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dock: &#39;bottom&#39;,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; displayInfo: true&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }]&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}); &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here dockedItems has been used for pagination.&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;Please dont forget to put your feedback. Please also give 
suggestion to improve this blog.

Other useful blogs.

http://binodjava.blogspot.com
http://binodsumanflex.blogspot.com
http://binodservlet.blogspot.com
http://binodjsf.blogspot.com
http://binodstock.blogspot.com&lt;/div&gt;</description><link>http://binodsuman.blogspot.com/2015/01/extjs-51-gridpanel-basic-example.html</link><author>noreply@blogger.com (Binod Suman)</author><thr:total>0</thr:total></item></channel></rss>