jQuery UI Widgets › Forums › Plugins › Validator, Drag & Drop, Sortable › widget is not compatible in ie 8
Tagged: Browser Compatibility, browser support, ie, IE8, Internet Explorer 8, jqxvalidator, syntax, validator
This topic contains 5 replies, has 3 voices, and was last updated by Dimitar 7 years, 3 months ago.
-
Author
-
I am using jqxwidget grid andvalidator in my code which works fine in firefox and crome. but gievs error in ie 8
$(document).ready(function(){
//===========================
// show the grid for blacklist itemid
//===========================var url = “/blacklists/blacklistitemidjson”; // action from where we get the result in json
var source =
{
datatype: “json”,
datafields:
[
{ name: ‘ItemID’, type: ‘string’ },
{ name: ‘Comment’, type: ‘string’ },
{ name: ‘AddedBlackListTimeStamp’, type: ‘date’ },
],
updaterow: function (rowid, rowdata, commit) {
// synchronize with the server – send update command
},
id: ‘Id’,
url: url,
pagesize: ’30’,
};var dataAdapter = new $.jqx.dataAdapter(source, {
loadComplete: function (data) { },
loadError: function (xhr, status, error) { },
beforeLoadComplete: function (records, originalData, c) {
for (var i = 0; i < records.length; i++) {
if(originalData[i].AddedBlackListTimeStamp==”0″){
records[i].AddedBlackListTimeStamp=””
}else{
records[i].AddedBlackListTimeStamp = new Date(originalData[i].AddedBlackListTimeStamp * 1000)
}
};
return records;
},
});
var editrow = ‘-1′;// initialize jqxGrid
$(“#jqxgrid”).jqxGrid(
{
width:’100%’,
theme: KiouiTheme,
height: ‘350’,
source: dataAdapter,
pageable: true,
autoheight: true,
sortable: true,
altrows: true,
enabletooltips: true,
pagesizeoptions: [’10’, ’20’, ’30’,’40’],
showfilterrow: true,
filterable: true,
showtoolbar: false,
enablebrowserselection: true,// columns shown in grid are mention below
columns: [
{ text: ”, datafield: ‘Edit’, columntype: ‘number’,filterable: false, sortable: false ,width: ‘5%’,
cellsrenderer: function () {
return ‘<div style=”width: 100%”></div>’;
}
},
{ text: ‘Date (PST)’, datafield: ‘AddedBlackListTimeStamp’, width: ‘25%’, type: ‘date’, cellsformat: DateTimeFomat},
{ text: ‘ItemId’, datafield: ‘ItemID’, width: ‘30%’ },
{ text: ‘Comment’, datafield: ‘Comment’, width: ‘35%’},{ text: ”, datafield: ‘Delete’, columntype: ‘number’,filterable: false, sortable: false ,width: ‘5%’,
cellsrenderer: function () {
return ‘<div></div>’;
}
},
]});
// initialize the popup window and buttons.
$(“#popupWindow”).jqxWindow({
width: ‘750’, height: ‘300’, resizable: false, isModal: true, autoOpen: false, cancelButton: $(“#cancel”),
modalOpacity: ‘0.01’,
theme: KiouiTheme
});// update the edited row when the user clicks the ‘Save’ button.
$(‘#Save’).on(‘click’, function () {
var check= $(‘.validForm1’).jqxValidator(‘validate’);
if(check){
submitonEdit();
}else{
return false;
}
});$(‘.itemid1’).jqxInput({ });
$(‘.validForm1’).jqxValidator({
rules: [
{ input: ‘.itemid1’, message: ‘Item id should be required’, action: ‘keyup’, rule: ‘required’},
{ input: ‘.itemid1’, message: ‘Item id should be in numeric’, action: ‘keyup, focus’, rule: function (input, commit) {
var rege = /[0-9 -()+]+$/;
if(rege.test($(‘.itemid1’).val())){
return true;
}
return false;
}
},
],
theme: ‘KiouiTheme’
});function submitonEdit(){
// $(“#Save”).click(function () {if (editrow >= ‘0’) {
var rowID = $(‘#jqxgrid’).jqxGrid(‘getrowid’, editrow);
var row = {
ItemID : $(“#ItemID”).val(),
Comment : $(“#Comment”).val(),
Id : rowID,
};// ajax called to UPDATE the row on edit
$.ajax({
url: ‘/blacklists/addblacklistitemidajax’,
data: row,
type: “POST”,
cache: false,
async: false,
success: function(response)
{
if(response==”success”){
window.location.reload();
}else{
alert(‘Something went wrong please try again.’);
}
},
error: function (response) {
// cancel changes.
alert(‘Something went wrong please try again.’);
}
});// $(“#popupWindow”).jqxWindow(‘hide’);
}
// });
} // function ends here// on click of edit and delete
$(“#jqxgrid”).on(“cellclick”, function (event) {
var column = event.args.column;
var rowindex = event.args.rowindex;
var columnindex = event.args.columnindex;//when user wants to edit the record
if (columnindex == ‘0’) {// open the popup window when the user clicks a button.
editrow = rowindex;
var offset = $(“#jqxgrid”).offset();
$(“#popupWindow”).jqxWindow({
theme: KiouiTheme,
position: { x: parseInt(offset.left) + 60, y: parseInt(offset.top) + 60}
});
// get the clicked row’s data and initialize the input fields.
var dataRecord = $(“#jqxgrid”).jqxGrid(‘getrowdata’, editrow);
$(“#ItemID”).val(dataRecord.ItemID);
$(“#Comment”).val(dataRecord.Comment);
// show the popup window.
$(“#popupWindow”).jqxWindow(‘show’);};
// if user click want to delete record
if (columnindex == 4){
if(confirm(‘Are you sure you want to delete this record?’)){deleterow = rowindex;
var rowID = $(‘#jqxgrid’).jqxGrid(‘getrowid’, deleterow ); // fetch the deleted id
var del= “param=delete&Id=” + rowID ;
$.ajax({
url: ‘/blacklists/deleteblacklistitemidajax’,
data: del,
type: “POST”,
cache: false,
async: false,
success: function(response)
{
if(response==”success”){
window.location.reload();
}
}
});
};
};
});//======================================================
// called ajax to save the data on click of “add blacklist user”
//=======================================================
$(‘#addRecord’).on(‘click’, function () {
var check= $(‘.validForm’).jqxValidator(‘validate’);
if(check){
submit();
}else{
return false;
}
});$(‘.itemid’).jqxInput({ });
$(‘.validForm’).jqxValidator({
rules: [
{ input: ‘.itemid’, message: ‘Item id should be required’, action: ‘keyup’, rule: ‘required’},
{ input: ‘.itemid’, message: ‘Item id should be in numeric’, action: ‘keyup, focus’, rule: function (input, commit) {
var rege = /[0-9 -()+]+$/;
if(rege.test($(‘.itemid’).val())){
return true;
}
return false;
}
},
],
theme: ‘KiouiTheme’
});function submit(){
// $(“#addRecord”).click(function (){$.ajax({
url: “/blacklists/addblacklistitemidajax”,
type: “POST”,
cache: false,
async: false,
data: $(“#addForm”).serialize(),
success: function(response)
{
if(response==”success”){
$(‘#TempForm’).jqxWindow(‘close’);
window.location.reload();
}
}
});
$(“#addForm”).submit( function(){
return false;
});
// });
}});
//==================================================================
// window open in blacklist view “/blacklists/blacklistitemid”
//==================================================================
var basicDemo = (function () {
//Adding event listeners
function _addEventListeners() {
$(‘#addrowbutton1’).click(function () {
$(‘#SystemBlackListItemidItemID’).val(”);
$(‘#SystemBlackListItemidComment’).val(”);
$(‘#TempForm’).jqxWindow(‘open’); // to open the window onclick of open button
});
$(‘#hideWindowButton’).mousedown(function () {
$(‘#TempForm’).jqxWindow(‘close’); // to close the add emailtemplate window onclick of cancel button
});
$(‘#cancel’).mousedown(function () {
$(‘#popupWindow’).jqxWindow(‘close’); // to close the edit emailtemplate window onclick of cancel button
});
};//Creating all page elements which are jqxWidgets
function _createElements() {
$(‘#addrowbutton1′).jqxButton({ width: ’70px’,theme: KiouiTheme });
};//Creating the window
function _createWindow() {
$(‘#TempForm’).jqxWindow({
theme: KiouiTheme,
showCollapseButton: true, maxHeight: ‘300’, maxWidth: ‘750’, minHeight: ‘250’, minWidth: ‘650’, height: ‘300’, width: ‘750’, autoOpen: false,
initContent: function () {
$(‘#TempForm’).jqxWindow(‘focus’);
}
});
};
return {
config: {
dragArea: null
},
init: function () {
_createElements();
_addEventListeners();
_createWindow();
}
};
} ());$(document).ready(function () {
//Initializing the demo
basicDemo.init();
});in above code i have added the ” where we are using numeric number. so most of the code is working now.
but now it gives error in validator.js file:-
Webpage error detailsUser Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3)
Timestamp: Fri, 19 Sep 2014 07:12:19 UTCMessage: ‘position’ is null or not an object
Line: 7
Char: 6376
Code: 0
URI: http://kifeedbackpro2.kioui-apps.com/jqwidgets/jqxvalidator.js
can you please help me outHello pankhi,
The widgets are fully compatible with Internet Explorer 8, as demonstrated by the demos.
You code, however, contains some syntax errors which most probably cause the error, such as:
function submitonEdit(){ // $(“#Save”).click(function () { if (editrow >= ’0′) { var rowID = $(‘#jqxgrid’).jqxGrid(‘getrowid’, editrow); var row = { ItemID : $(“#ItemID”).val(), Comment : $(“#Comment”).val(), Id : rowID, };
Before closing objects, make sure you have no unnecessary commas.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/i have tried this without quotes(”) too..and still facing the same issue.
Hi pankhi,
Which quotes are you referring to? There are multiple syntax issues in the posted sample, including a number of commas before closing braces of objects ( } ).
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/hi can you tell me which IE versions jQWidgets support ?
Hello marwan.alqassas,
As stated on the Documentation page, jQWidgets supports all major desktop and mobile web browsers – Edge, Internet Explorer 7.0+, Firefox 2.0+, Safari 3.0+, Opera 9.0+, Google Chrome, IE Mobile, Android, Opera Mini, Mobile Safari(IPhone, IPad).
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.