Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
345
dataSource.type()==="remoteUrl" is setting null
posted

Hi,

in my case if i try to bind grid using below mentioned datasource url

function GetDetailForInvoiceLanguage() {

LoadInvoiceLanguageListINGrid(null);
DestroyDependentGrid();
$("#PickList").addClass("modalMain").fadeIn("slow");
ParentGridFristRowSelection();
}

function LoadInvoiceLanguageListINGrid(datasource) {
var showInactiveColumn = GetInactiveCheckboxValue();
DestroyParentGrid();
$("#gridPickList").igGrid({
primaryKey: "InvoiceLanguageID",
autoGenerateColumns: false,
width: "500px",
height: parentGridHeight,
caption: $("#hdnGridCaptionText").val(),
renderCheckboxes: true,
aggregateTransactions: true,
responseDataKey: 'Records',
responseDataType: "jsonp",
requestError: ShowRequesterror,
updateUrl: '@Url.Content("~/PickList/SaveInvoiceLanguagePickList")',
columns: [
{ headerText: "Invoice Language ID", key: "InvoiceLanguageID", dataType: "number", width: "25px" },
{ headerText: "Inactive", key: "Inactive", dataType: "bool", width: "75px" },
{ headerText: "Surveyor", key: "SurveyorID", dataType: "string", hidden: true, formatter: formatSurveyorCombo, width: "25px" },
{
headerText: "Surveyor", key: "Surveyor", unbound: true, dataType: "string", width: "150px", formula: function (row, grid) {
return formatSurveyorCombo(row.SurveyorID);
}
},
{ headerText: "Company", key: "NominatingCompanyID", dataType: "string", hidden: true, formatter: formatCompanyCombo, width: "25px" },
{
headerText: "Company", key: "Company", unbound: true, dataType: "string", width: "150px", formula: function (row, grid) {
return formatCompanyCombo(row.NominatingCompanyID);
}
},

{ headerText: "Text", key: "Text", dataType: "string", width: "100px" },

],

dataSource: '@Url.Content("~/PickList/GetDetailForInvoiceLanguage")' + '?isChecked=' + $('#hdnIsInActiveChecked').val(), //datasource,

features: [
{
name: 'Hiding',
//enableVerticalRendering: false,
columnSettings: [
{
columnKey: 'InvoiceLanguageID',
allowHiding: true,
hidden: true
},

{
columnKey: 'Inactive',
allowHiding: true,
hidden: showInactiveColumn //true
},

]
},

{
name: "Tooltips",
style: "popover",
visibility: "overflow",
showDelay: 500,
hideDelay: 100
},
{
name: "Responsive",
enableVerticalRendering: true,
reactOnContainerWidthChanges: true,
windowWidthToRenderVertically: null,
},
{
name: "Selection",
mode: "row",
multipleSelection: false,
touchDragSelect: false, // this is true by default
multipleCellSelectOnClick: false
},
{
name: "Sorting",
type: "local"
},

{
name: "Filtering",
type: "local",
mode: "simple",
dataFiltering: PickListGridDataFiltering
},

{
name: 'Updating',
editMode: pickListGridEditMode,
enableAddRow: pickListGridEditMode == 'none' ? false : true,
enableDeleteRow: pickListGridEditMode == 'none' ? false : true,
columnSettings:
[
{
columnKey: "Inactive",
editorType: 'bool',
},

//{
// columnKey: "SurveyorID",
// editorType: 'combo',
// validation: true,
// required: true,
// editorOptions: {
// mode: "dropdown",
// dataSource: jsonsurveyorName,
// textKey: "Name",
// valueKey: "SurveyorID"

// }
//},

{
columnKey: "Surveyor",
editorType: 'combo',
validation: true,
required: true,
editorOptions: {
id: "comboSurveyor",
mode: "dropdown",
dataSource: jsonsurveyorName,
textKey: "Name",
valueKey: "Name"

}
},

{
columnKey: "Company",
editorType: 'combo',
validation: true,
required: true,
editorOptions: {
id: "comboCompany",
mode: "dropdown",
dataSource: jsonNominatingCompanies,
textKey: "Name",
valueKey: "Name"

}
},

//{
// columnKey: "NominatingCompanyID",
// editorType: 'combo',
// validation: true,
// required: true,
// editorOptions: {
// mode: "dropdown",
// dataSource: jsonNominatingCompanies,
// textKey: "Name",
// valueKey: "NominatingCompanyID"

// }
//},

{
columnKey: "Text",
editorType: 'string',
validation: true,
editorOptions: { required: true }
}],

}
}
else {
var surveyorCombo = ui.owner.editorForKey("Surveyor").data("igCombo");
var surveyorID = surveyorCombo.options.dataSource[surveyorCombo.selectedIndex()]["SurveyorID"];
var companyCombo = ui.owner.editorForKey("Company").data("igCombo");
var companyID = companyCombo.options.dataSource[companyCombo.selectedIndex()]["NominatingCompanyID"];
var row = ui.values;
row["SurveyorID"] = surveyorID;
row["NominatingCompanyID"] = companyID;
}

}
]

});
}

on executing of   SaveUnSaveGridOnConfirmation('fromPickList', this); function getting hanged and below error is coming

if(this.options.dataSourceUrl||this.dataSource.type()==="remoteUrl"

Detaill of   function SaveUnSaveGridOnConfirmation(calledFromMethodName, currentPickListObject)  is as follows

function SaveUnSaveGridOnConfirmation(calledFromMethodName, currentPickListObject) {

EndEditChangesOnSaveAndReload();

if (($("#gridPickList").data("igGrid") != null && HasPendingTransactions($("#gridPickList"))) || ($("#gridDependentPickList").data("igGrid") != undefined && HasPendingTransactions($("#gridDependentPickList")))) {

$("#dialogYesNoCancel>p>label").text("There are unsaved changes on this screen. Do you want to save them first before closing?");
$("#dialogYesNoCancel").dialog({
resizable: false,
height: 140,
modal: true,
buttons: {
"Yes": function () {
if (HasPendingTransactions($("#gridPickList")) == true) {
$("#gridPickList").igGrid("saveChanges");
isPicklistModified = true;
RefreshParentGrid();
alert("changes have been saved");
$(this).dialog("close");
alert("ok2");
}
if ($("#gridDependentPickList").data("igGrid") != undefined) {
if (HasPendingTransactions($("#gridDependentPickList")) == true) {
$("#gridDependentPickList").igGrid("saveChanges");
isPicklistModified = true;
RefreshDependentGrid();
alert("changes have been saved");
$(this).dialog("close");
}
}
if (calledFromMethodName == 'fromChkShowInactiveRows') {
alert("ok3");
if ($("#chkShowInactiveRows").is(':checked')) {
$('#chkShowInactiveRows').prop('checked', false);
} else {
$('#chkShowInactiveRows').prop('checked', true);
}
doCheckUnCheckActivity();
alert("ok4");
}

if (calledFromMethodName == 'fromPickList') {
alert("ok5");
//if ($("#chkShowInactiveRows").is(':checked')) {
// $('#chkShowInactiveRows').prop('checked', true);
//} else {
// $('#chkShowInactiveRows').prop('checked', false);
//}
//doCheckUnCheckActivity();
doPickListActivity(currentPickListObject);
alert("ok6");

}

if (calledFromMethodName == 'frombtnClosePick') {
alert("ok7");
//if ($("#chkShowInactiveRows").is(':checked')) {
// $('#chkShowInactiveRows').prop('checked', false);
//} else {
// $('#chkShowInactiveRows').prop('checked', true);
//}
btnCloseActivity();

}
alert("ok8");
//ReloadNominationForm();
},
"NO": function () {
alert("changes have not been saved");
$(this).dialog("close");
ReloadGrid($("#hdnGridName").val());
//if (HasPendingTransactions($("#gridPickList")) == true) {
// RollbackChangesForParentGrid();
// alert("changes have not been saved");
// $(this).dialog("close");
//}
//if ($("#gridDependentPickList").data("igGrid") != undefined) {
// if (HasPendingTransactions($("#gridDependentPickList")) == true) {
// RollbackChangesForDependentParentGrid();
// alert("changes have not been saved");
// $(this).dialog("close");
// }
//}
if (calledFromMethodName == 'fromChkShowInactiveRows') {

if ($("#chkShowInactiveRows").is(':checked')) {
$('#chkShowInactiveRows').prop('checked', false);
} else {
$('#chkShowInactiveRows').prop('checked', true);
}
doCheckUnCheckActivity();
}

if (calledFromMethodName == 'fromPickList') {

//if ($("#chkShowInactiveRows").is(':checked')) {
// $('#chkShowInactiveRows').prop('checked', false);
//} else {
// $('#chkShowInactiveRows').prop('checked', true);
//}
doPickListActivity(currentPickListObject);
}
alert("afterendofpicklis");
if (calledFromMethodName == 'frombtnClosePick') {

//if ($("#chkShowInactiveRows").is(':checked')) {
// $('#chkShowInactiveRows').prop('checked', false);
//} else {
// $('#chkShowInactiveRows').prop('checked', true);
//}
btnCloseActivity();
}
alert("afterendofclose");
//ReloadNominationForm();
},
Cancel: function () {
$(this).dialog("close");
return false;
}

}

});

return false;
}


}

Please let me know why executing SaveUnSaveGridOnConfirmation , a dialogbox opens and when i clicked on "Yes", getting hanged

and error is coming (if(this.options.dataSourceUrl||this.dataSource.type()==="remoteUrl" is coming null)

Early response is appreciated.

Thanks,

Poonam