ctor()
jQuery
JavaScript
var guid = new DevExpress.data.Guid();
Angular
TypeScript
import Guid from "devextreme/core/guid"; // ... export class AppComponent { constructor() { let guid = new Guid(); } }
Vue
App.vue
<script> import Guid from 'devextreme/core/guid'; export default { mounted() { this.guid = new Guid(); }, // ... } </script>
React
App.js
// ... import Guid from 'devextreme/core/guid'; class App extends React.Component { constructor(props) { super(props); this.guid = new Guid(); } } export default App;
ctor(value)
Parameters:
value:
Hyphens in the GUID are optional:
jQuery
JavaScript
var guid = new DevExpress.data.Guid("40810dcc-e08b-10a2-8227-c67c8933c31a"); // or var guid = new DevExpress.data.Guid("40810dcce08b10a28227c67c8933c31a");
Angular
TypeScript
import Guid from "devextreme/core/guid"; // ... export class AppComponent { constructor() { let guid = new Guid("40810dcc-e08b-10a2-8227-c67c8933c31a"); // or let guid = new Guid("40810dcce08b10a28227c67c8933c31a"); } }
Vue
App.vue
<script> import Guid from 'devextreme/core/guid'; export default { mounted() { this.guid = new Guid("40810dcc-e08b-10a2-8227-c67c8933c31a"); // or this.guid = new Guid("40810dcce08b10a28227c67c8933c31a"); }, // ... } </script>
React
App.js
// ... import Guid from 'devextreme/core/guid'; class App extends React.Component { constructor(props) { super(props); this.guid = new Guid("40810dcc-e08b-10a2-8227-c67c8933c31a"); // or this.guid = new Guid("40810dcce08b10a28227c67c8933c31a"); } } export default App;
toString()
Gets the GUID. Works identically to the valueOf() method.
Return Value:
The returned GUID is always hyphened even if the Guid was created with a non-hyphened version:
jQuery
JavaScript
var guid = new DevExpress.data.Guid("40810dcce08b10a28227c67c8933c31a"); console.log(guid.toString()); // logs 40810dcc-e08b-10a2-8227-c67c8933c31a
Angular
TypeScript
import Guid from "devextreme/core/guid"; // ... export class AppComponent { constructor() { let guid = new Guid("40810dcce08b10a28227c67c8933c31a"); console.log(guid.toString()); // logs 40810dcc-e08b-10a2-8227-c67c8933c31a } }
Vue
App.vue
<script> import Guid from 'devextreme/core/guid'; export default { mounted() { this.guid = new Guid("40810dcce08b10a28227c67c8933c31a"); console.log(this.guid.toString()); // logs 40810dcc-e08b-10a2-8227-c67c8933c31a }, // ... } </script>
React
App.js
// ... import Guid from 'devextreme/core/guid'; class App extends React.Component { constructor(props) { super(props); this.guid = new Guid("40810dcce08b10a28227c67c8933c31a"); console.log(this.guid.toString()); // logs 40810dcc-e08b-10a2-8227-c67c8933c31a } } export default App;
valueOf()
Gets the GUID. Works identically to the toString() method.
Return Value:
The returned GUID is always hyphened even if the Guid was created with a non-hyphened version:
jQuery
JavaScript
var guid = new DevExpress.data.Guid("40810dcce08b10a28227c67c8933c31a"); console.log(guid.valueOf()); // logs 40810dcc-e08b-10a2-8227-c67c8933c31a
Angular
TypeScript
import Guid from "devextreme/core/guid"; // ... export class AppComponent { constructor() { let guid = new Guid("40810dcce08b10a28227c67c8933c31a"); console.log(guid.valueOf()); // logs 40810dcc-e08b-10a2-8227-c67c8933c31a } }
Vue
App.vue
<script> import Guid from 'devextreme/core/guid'; export default { mounted() { this.guid = new Guid("40810dcce08b10a28227c67c8933c31a"); console.log(this.guid.valueOf()); // logs 40810dcc-e08b-10a2-8227-c67c8933c31a }, // ... } </script>
React
App.js
// ... import Guid from 'devextreme/core/guid'; class App extends React.Component { constructor(props) { super(props); this.guid = new Guid("40810dcce08b10a28227c67c8933c31a"); console.log(this.guid.valueOf()); // logs 40810dcc-e08b-10a2-8227-c67c8933c31a } } export default App;
Feel free to share topic-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you for the feedback!
If you have technical questions, please create a support ticket in the DevExpress Support Center.