function onSuccessBindWidgetInvoice(result) { debugger; if (result != null) { if (pgrInvoices == null && pgrInvoices == undefined) { widgetId = 'widgetInvoices'; var loadedResult = Sys.Serialization.JavaScriptSerializer.deserialize(result); if (loadedResult.Table.length > 0) { widgetTitle = loadedResult.Table[0].ItemType; var getWidgetHtmlMarkup = getWidgetHtml(widgetId, widgetTitle); if ($get(widgetId) != null && $get(widgetId) != undefined) { var htmlMarkup = getWidgetHtmlMarkup + createRows(loadedResult.Table.length, loadedResult.Table, widgetId); var htmlMarkup = htmlMarkup + createPager(widgetId); $get(widgetId).innerHTML = htmlMarkup; pgrInvoices = $create(GEP.Scripts.Pager, { 'ImagePath': '../images/' }, null, null, $get('dvPager_' + widgetId)); pgrInvoices.set_WebServiceFn(bindWidgetInvoice); pgrInvoices._ddlPageSize.value = 10; pgrInvoices.set_StartIndex(1); pgrInvoices.set_PageSize(5); pgrInvoices.set_TotalCount(loadedResult.Table[0].TotalCount); } else alert('Unable to attach ' + widgetId); } } else { widgetId = 'widgetInvoices'; var loadedResult = Sys.Serialization.JavaScriptSerializer.deserialize(result); if (loadedResult.Table.length > 0) { widgetTitle = loadedResult.Table[0].ItemType; if ($get(widgetId) != null && $get(widgetId) != undefined) { var htmlRowMarkup = ''; htmlRowMarkup = createRows(loadedResult.Table.length, loadedResult.Table, widgetId); $get('placedivAttContent_' + widgetId).innerHTML = htmlRowMarkup; pgrInvoices.set_TotalCount(loadedResult.Table[0].TotalCount); } else alert('Unable to attach ' + widgetId); } } } changeLoadingImgVisibility(); $(document).ready(function () { //$('#widgetOrders').hide(); $('#widgetInvoices').fadeIn(900); }); }
if (result != null && result.Table != null && result.Table.length > 0) { // your existing code } else { // error message or warning message... }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)