You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.5 KiB

4 years ago
  1. //CdnPath=http://ajax.aspnetcdn.com/ajax/4.5.1/1/GridView.js
  2. function GridView() {
  3. this.pageIndex = null;
  4. this.sortExpression = null;
  5. this.sortDirection = null;
  6. this.dataKeys = null;
  7. this.createPropertyString = GridView_createPropertyString;
  8. this.setStateField = GridView_setStateValue;
  9. this.getHiddenFieldContents = GridView_getHiddenFieldContents;
  10. this.stateField = null;
  11. this.panelElement = null;
  12. this.callback = null;
  13. }
  14. function GridView_createPropertyString() {
  15. return createPropertyStringFromValues_GridView(this.pageIndex, this.sortDirection, this.sortExpression, this.dataKeys);
  16. }
  17. function GridView_setStateValue() {
  18. this.stateField.value = this.createPropertyString();
  19. }
  20. function GridView_OnCallback (result, context) {
  21. var value = new String(result);
  22. var valsArray = value.split("|");
  23. var innerHtml = valsArray[4];
  24. for (var i = 5; i < valsArray.length; i++) {
  25. innerHtml += "|" + valsArray[i];
  26. }
  27. context.panelElement.innerHTML = innerHtml;
  28. context.stateField.value = createPropertyStringFromValues_GridView(valsArray[0], valsArray[1], valsArray[2], valsArray[3]);
  29. }
  30. function GridView_getHiddenFieldContents(arg) {
  31. return arg + "|" + this.stateField.value;
  32. }
  33. function createPropertyStringFromValues_GridView(pageIndex, sortDirection, sortExpression, dataKeys) {
  34. var value = new Array(pageIndex, sortDirection, sortExpression, dataKeys);
  35. return value.join("|");
  36. }