View Full Version : [CLOSED] Create GUID

Jan 14, 2015, 2:09 PM
How to use EXTJS create guid ?

Jan 14, 2015, 2:20 PM

I do not know of any "create guid" functionality within ExtJS.

If you provide a link to something specific to ExtJS and we should be able to offer suggestions on how to use within Ext.NET.

Jan 14, 2015, 2:37 PM
hello my friend. I need to create the script side.

Jan 14, 2015, 8:03 PM
Hi @siyahgul,

Please clarify do you need to generate some GUID in JavaScript?

If yes, you could try with


It generates an id that is unique in the current page.

Jan 14, 2015, 9:27 PM
Or, if I have understood the question correctly, having server side provide (new) GUID to the client, for example:

<%@ Page Language="C#" %>

<script runat="server">
public Guid GetGuid()
return Guid.NewGuid();

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

<form id="form1" runat="server">
<ext:ResourceManager runat="server" />
<ext:Button ID="Button1" runat="server" Text="Get GUID" Icon="Lightning">
<Click Handler="
success: function (result) {
Ext.Msg.alert('Guid created: ', result);
});" />

Jan 15, 2015, 4:09 PM
now we can not create a guid in client side?

Jan 15, 2015, 4:55 PM
If you want to create just a simple ID guaranteed to be unique on the page, the solution Daniil provided you with does the trick.

Every time you call Ext.id() it generates an unique ID you can use on the page elements/controls (avoiding ID conflicts). That's if what you need is unique IDs for HTML or Ext elements.

If what you want is really a fully fledged GUID client-side, all you have to do is use this simple script (http://guid.us/GUID/JavaScript) on your pages.

By the way, don't think GUID is unique, always. A friend just had an entire site overwritten by believing he will never hit a duplicated GUID. After rendering an GUID, always verify whether it already exists on your sample or not. If it exists, just keep re-generating, your chances of having duplicates are quite low.

I hope this helps.

Jan 16, 2015, 10:15 AM
I need to use the database. Ext.id not help me. need to look at the JavaScript function. Thanks to everyone.