Ask Question Forum:
Model Library:2025-02-08 Updated:A.I. model is online for auto reply question page
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by ank5
at 2024-11-04 11:11:07
Point:500 Replies:8 POST_ID:828777USER_ID:11616
Topic:
JavaScript;Web Languages/Standards;Scripting Languages
I have an Ext JS function in which I was displaying a javascript alert and it worked perfectly fine.
if(matchStatus == false) { alert('Please refine your selection'); return false; } 1:2:3:4:
Now I want to display an Ext JS alert instead of Javascript alert, so I changed the above code to
if(matchStatus == false) { Ext.Msg.alert("Alert", "Please refine your selection");" return false;" } 1:2:3:4:
Now this code does not work. In my UI, I get an blank alert window (please refer to the attached screenshot).
Can someone please help me resolve this problem. Thank you.
Attachment:Alert.jpg
Accepted Solution
Expert: duncanb7 replied at 2024-11-07 11:22:59
250 points EXCELLENT
Could you send us your file with all link or script file you include
in the html fille , not just function code but also something like as follows
<link rel="stylesheet"type="text/css"
href="lib/extjs/resources/css/ext-all.css"/>
<script src="lib/extjs/adapter/ext/ext-base.js"></script>
<script src="lib/extjs/ext-all-debug.js"></script>
in the html fille , not just function code but also something like as follows
<link rel="stylesheet"type="text/css"
href="lib/extjs/resources/css/ext-all.css"/>
<script src="lib/extjs/adapter/ext/ext-base.js"></script>
<script src="lib/extjs/ext-all-debug.js"></script>
Author: ank5 replied at 2024-11-05 22:04:13
Tried this but it didn't help either
Ext.namespace('m2n');(function() { m2n.getLinkStatus = function(folderObjID, docParentFolderIDs) { var matchStatus = true; folderObjID = folderObjID+""; docParentFolderIDs = docParentFolderIDs+""; var folderObjIDArray = ''; var docParentFolderIDsArray = ''; if(folderObjID != '') { folderObjIDArray = folderObjID.split(','); } if(docParentFolderIDs != '') { docParentFolderIDsArray = docParentFolderIDs.split(','); } for(var i = 0; i < folderObjIDArray.length; i++){ for(var j = 0; j < docParentFolderIDsArray.length; j++){ if(folderObjIDArray[i].indexOf(docParentFolderIDsArray[j]) > -1) { matchStatus = false; } } } if(matchStatus == false) { Ext.onReady(function(){ Ext.MessageBox.alert("Alert1", "Please refine your selection1"); }); return false; } return matchStatus; };})(); 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:31:32:33:34:35:
Assisted Solution
Expert: mikeyd234 replied at 2024-11-05 09:55:08
250 points EXCELLENT
Also, make sure you've included the default Ext theme / style-sheet on your page. I've forgotten to do it once or twice and things look weird - just like in your screenshot.
Another thing,
Use the the short form like in your first post :D less typing, boo to Ext.MessageBox.alert :)
Another thing,
Use the the short form like in your first post :D less typing, boo to Ext.MessageBox.alert :)
Expert: duncanb7 replied at 2024-11-05 09:51:52
Yes, mikey, that is typing mistake
Expert: mikeyd234 replied at 2024-11-05 09:42:08
Author: ank5 replied at 2024-11-04 20:48:46
Here is my complete code. This functions is called from UI. The Javascript alert works fine but Ext JS alert doesn't
(function() { m2m.getLinkStatus = function(folderObjID, docParentFolderIDs) { var matchStatus = true; folderObjID = folderObjID+""; docParentFolderIDs = docParentFolderIDs+""; var folderObjIDArray = ''; var docParentFolderIDsArray = ''; if(folderObjID != '') { folderObjIDArray = folderObjID.split(','); } if(docParentFolderIDs != '') { docParentFolderIDsArray = docParentFolderIDs.split(','); // alert('array size docParentFolderIDsArray '+docParentFolderIDsArray.length); } for(var i = 0; i < folderObjIDArray.length; i++){ for(var j = 0; j < docParentFolderIDsArray.length; j++){ if(folderObjIDArray[i].indexOf(docParentFolderIDsArray[j]) > -1) { matchStatus = false; } } } if(matchStatus == false) { // Ext.Msg.alert("Alert", "Please refine your selection"); // alert('Please refine your selection'); Ext.onready(function(){ Ext.MessageBox.alert("Alert", "Please refine your selection"); }); return false; } return matchStatus; };})(); 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:31:32:33:34:35:36:37:
Also, the below code gives an error in Javascript console
Ext.onready(function(){ Ext.MessageBox.alert("Alert", "Please refine your selection"); }); 1:2:3:
Error is as follows
Expert: Rainer Jeschor replied at 2024-11-04 13:45:55
Hi,
as this very basic sample:
http://jsfiddle.net/EE_RainerJ/6S68L/
works as expected (and according to your screenshot the alert and the alert title are shown but not the message), I can only think of an issue in regards to the CSS.
Could you perhaps share more of your code or even better provide a link to the page?
Which exact version of Ext JS are you using?
Thanks.
Rainer
as this very basic sample:
http://jsfiddle.net/EE_RainerJ/6S68L/
works as expected (and according to your screenshot the alert and the alert title are shown but not the message), I can only think of an issue in regards to the CSS.
Could you perhaps share more of your code or even better provide a link to the page?
Which exact version of Ext JS are you using?
Thanks.
Rainer
Expert: duncanb7 replied at 2024-11-04 13:18:49
http://c4learn.com/tutorials/learn-extjs/alert-message-box-in-extjs/
take a look
and try to use
if(matchStatus == false) {
Ext.onready(function(){
Ext.MessageBox.alert("Alert", "Please refine your selection");
});
}
Hope it works
take a look
and try to use
if(matchStatus == false) {
Ext.onready(function(){
Ext.MessageBox.alert("Alert", "Please refine your selection");
});
}
Hope it works